init: expect fork/daemon do not work as expected
Bug #264711 reported by
Rolf Offermanns
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
Medium
|
Scott James Remnant (Canonical) | ||
upstart (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I use upstart-0.5.0.
I see the same problem as described by Adam Sampson on the upstart-devel list:
https:/
I try to start the dbus daemon with the "expect daemon" stanza (I also tried "fork"), but everytime I get the "main process killed by TRAP signal" message on the console.
The dbus job is in the "running" state after that! It this intended?
My job looks like this:
pre-start script
end script
respawn
expect daemon
exec /bin/dbus-daemon --system
Changed in upstart: | |
importance: | Undecided → Medium |
summary: |
- expect fork/daemon do not work as expected + init: expect fork/daemon do not work as expected |
Changed in upstart: | |
status: | Triaged → Fix Committed |
Changed in upstart: | |
assignee: | nobody → Scott James Remnant (scott) |
milestone: | none → 0.6.1 |
To post a comment you must log in.
I got similar problem.
I found that the dbus-daemon did not got respawn when it was kill. After I killed dbus-daemon, the dbus-daemon pid gone (not shown in ps command), but upstart initctl reported that dbus-daemon is still running.
Here are the steps I performed:
1) I listed the dbus-daemon pid to make sure it's running, and it had pid 1031. dbus-daemon --fork --system
bash-3.00# ps axg | grep dbus-daemon
1031 ? Ss 0:00 /usr/bin/
1060 ? R+ 0:00 grep dbus-daemon
2) Then checked whether the job is running: sbin/initctl status systembus
bash-3.00# /opt/upstart/
systembus running
3) Killed the dbus-daemon process, and verified pid 1031 is gone:
bash-3.00# pidof dbus-daemon | xargs kill
bash-3.00# ps axg | grep dbus-daemon
1066 ? R+ 0:00 grep dbus-daemon
4) After the kill above, upstart did not respawn dbus-daemon. Upstart think it's still alive: sbin/initctl status systembus
bash-3.00# /opt/upstart/
systembus running
5) Even when I had explicitly stop & start the job again, I did not see the dbus-daemon launched: sbin/initctl stop systembus sbin/initctl status systembus sbin/initctl start systembus sbin/initctl status systembus
bash-3.00# /opt/upstart/
bash-3.00# /opt/upstart/
systembus not running
bash-3.00# ps axg | grep dbus-daemon
bash-3.00# /opt/upstart/
init: systembus main process (1076) killed by TRAP signal
init: systembus main process ended, respawning
bash-3.00# /opt/upstart/
systembus running
bash-3.00# ps axg | grep dbus-daemon
1079 ? R+ 0:00 grep dbus-daemon
Here is my 'systembus' job script that start the dbus-daemon: jobs.d/ systembus
bash-3.00# cat /etc/init/
# DBUS system daemon
#
# started until it is shut down again.
start on stopped rc2 or stopped rc3 or stopped rc4 or stopped rc5
stop on runlevel 0 or runlevel 6
export PATH=/opt/ upstart/ sbin:$PATH
respawn
respawn limit 4 60
expect fork dbus-daemon --fork --system
exec /usr/bin/