[Bug 1225518] Re: upstart doesn’t start sh on first run, starts on subsequent runs
Artyom Kazak
Artyom.Kazak at gmail.com
Sat Sep 14 20:54:43 UTC 2013
Strangely enough, a possible workaround is to wrap “exec…” in “script …
end script”.
--
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/1225518
Title:
upstart doesn’t start sh on first run, starts on subsequent runs
Status in “upstart” package in Ubuntu:
New
Bug description:
Here’s an Upstart job, saved as /etc/init/r2.conf:
setuid rtorrent
exec screen -S rtorrent -fn -Dm rtorrent -n -o import=/tmp/rtconf
(rtorrent and screen are available from Ubuntu repositories.)
The first time I start it, everything is fine:
# touch /tmp/rtconf <-- creating empty config; needed only once
# service r2 start
r2 start/running, process 1007
# ps aux | grep rtorrent
rtorrent 1007 0.0 0.3 24132 1520 ? Ss 20:13 0:00 SCREEN -S rtorrent -fn -Dm rtorrent -n -o import=/tmp/rtconf
rtorrent 1008 0.2 1.2 262016 6388 pts/1 Ssl+ 20:13 0:00 rtorrent -n -o import=/tmp/rtconf
# service r2 stop
r2 stop/waiting
# ps aux | grep rtorrent
<nothing>
However, when I start it for the second time, “sh” appears from
nowhere:
# service r2 start
r2 start/running, process 1021
# ps aux | grep rtorrent
rtorrent 1021 0.0 0.1 4436 628 ? Ss 20:14 0:00 /bin/sh -e -c screen -S rtorrent -fn -Dm rtorrent -n -o import=/tmp/rtconf /bin/sh
rtorrent 1022 0.0 0.3 24132 1524 ? Ss 20:14 0:00 SCREEN -S rtorrent -fn -Dm rtorrent -n -o import=/tmp/rtconf
rtorrent 1023 0.0 1.2 262016 6428 pts/2 Ssl+ 20:14 0:00 rtorrent -n -o import=/tmp/rtconf
What’s worse, due to this it doesn’t stop as expected:
# service r2 stop
r2 stop/waiting
# ps aux | grep rtorrent
rtorrent 1022 0.0 0.3 24132 1524 ? Ss 20:14 0:00 SCREEN -S rtorrent -fn -Dm rtorrent -n -o import=/tmp/rtconf
rtorrent 1023 0.0 1.2 262016 6428 pts/2 Ssl+ 20:14 0:00 rtorrent -n -o import=/tmp/rtconf
The version of Ubuntu I’m using is 13.04 x64. The version of Upstart
is 1.8-0ubuntu1.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1225518/+subscriptions
More information about the foundations-bugs
mailing list