upstart loses track of process ID when /etc/default/ entry contains backticks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
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/
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/
# 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/
OPTION=`uname -m`
# cat /etc/init/
description "Test Application"
author "<email address hidden>"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork # have also tried 'expect daemon'
respawn
script
if [ -f /etc/default/
. /etc/default/
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://
*** 1.5-0ubuntu5 0
500 http://
100 /var/lib/
Status changed to 'Confirmed' because the bug affects multiple users.