[Bug 1000246] Re: upstart loses track of process ID when /etc/default/ entry contains backticks
Launchpad Bug Tracker
1000246 at bugs.launchpad.net
Wed Jun 6 12:31:32 UTC 2012
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: upstart (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/1000246
Title:
upstart loses track of process ID when /etc/default/ entry contains
backticks
Status in “upstart” package in Ubuntu:
Confirmed
Bug description:
Initially noticed with our autofs5 configuration, which uses `uname `
to set some architecture specific options for a software distribution
mount.
If /etc/default/testapp contains an entry like:
OPTION=`uname -m`
Then upstart gets the wrong PID for the daemon. This means we can't
stop/restart the service, and shutting down the machine is impossible
without resetting the power - upstart hangs looking for the wrong
process ID.
# status testapp
testapp start/running, process 854
# ps -ef | grep testapp
root 855 1 0 15:04 ? 00:00:00 /root/testapp
Take the backticks out of /etc/default/testapp and things work as
expected.
# cat testapp.c
#include <sys/types.h>
int main(void) {
pid_t pid = fork();
if ( pid == 0 ) {
while(1) {
sleep(10);
}
} else {
return(0);
}
}
# cat /etc/default/testapp
OPTION=`uname -m`
# cat /etc/init/testapp.conf
description "Test Application"
author "foo at bar.com"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork # have also tried 'expect daemon'
respawn
script
if [ -f /etc/default/testapp ] ; then
. /etc/default/testapp
fi
exec /root/testapp
end script
lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
# apt-cache policy upstart
upstart:
Installed: 1.5-0ubuntu5
Candidate: 1.5-0ubuntu7
Version table:
1.5-0ubuntu7 0
500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
*** 1.5-0ubuntu5 0
500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1000246/+subscriptions
More information about the foundations-bugs
mailing list