Comment 15 for bug 703993

Revision history for this message
Jean-Baptiste Wons (wonsjb) wrote :

It looks like I ran into the same problem.

Here is my init config file:
expect daemon
exec su debian -c 'exec /usr/bin/gpg-agent --daemon --sh --allow-preset-passphrase --write-env-file /home/debian/.gpg-agent.pid'

I also tried with expect fork, same result.

Basically, upstart gets confused on what pid the final process has.
emily:/etc/init# initctl list | grep killed
debian-agent4 stop/killed, process 5003
debian-agent5 stop/killed, process 5399
debian-agent2 stop/killed, process 4707
debian-agent stop/killed, process 3338
debian-agent3 stop/killed, process 4857

Those PID do not exist anymore, and my guess is that they where the parent process of the process I expect upstart to monitor.

I fixed my configuration file, by using a custom version of su that does not fork, but just exec what I give to it, so I have it working (with expect fork, as gpg-agent is still doing his own fork)

emily:/etc/init# initctl status debian-agent6
debian-agent6 start/running, process 11438
emily:/etc/init# ps aux | grep 11438
debian 11438 0.0 0.0 21412 512 ? Ss 21:57 0:00 /usr/bin/gpg-agent --batch --log-file /home/debian/gpg-agent.log --daemon --sh --allow-preset-passphrase --write-env-file /home/debian/.gpg-agent.pid

But still, I cannot get rid of those 5 other tasks, as upstart is waiting for a SIGCHLD for a process that do not exists anymore. A wild guess is that it started accepting somehow this signal after the process was dead, and SIGCHLD was delivered, but I would need to look at the source code to confirm it.
And as init is not something that I can restart, it looks like those ghost tasks will stay until the next reboot of that server.

Thanks,
Jean-Baptiste