shutdown: sets INIT_HALT as first argument, should be the last
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Invalid
|
High
|
Unassigned | ||
0.5 |
Fix Released
|
High
|
Unassigned |
Bug Description
upstart 0.5.0 with sysvinit compat.
When issuing poweroff then "The system is going down for power off NOW!" message is printed but nothing else happens. It doesn't start poweroff procedure.
Pasting #upstart conversation with myself... This should explain the problem.
23:12 < arekm> hi, is there anyone alive who could help me track one issue? poweroff from upstart is broadcasting message about system going "for
23:17 < arekm> I'm looking into ubuntu configs and actually I don't see where poweroff events are handled
23:31 < arekm> strace shows that init gets some message with "INIT_HALT=
23:42 < arekm> Nov 21 23:42:02 arm init: event_new: Pending runlevel event
23:42 < arekm> Nov 21 23:42:02 arm init: event_finished: Finished runlevel event
23:42 < arekm> but hm, nothing is run
00:21 < arekm> "telinit 0" on the other hand works well
00:26 < arekm> "shutdown -P" now also does nothing but "shutdown -P now -h' shutdowns system and powersoff
00:26 < arekm> while according to manual -P implies -h
00:26 < arekm> s/manual/shutdown --help/
00:39 < arekm> looks like NIH_MUST (e = nih_sprintf (NULL, "INIT_HALT=%s", init_halt));
00:40 < arekm> or any other env sent (NIH_MUST (e = nih_sprintf (NULL, "BLABLA=ZIMA"));)
00:40 < arekm> causes init to behave wrongly
So INIT_HALT= is handled in a wrong way it seems.
summary: |
- shutdown sets INIT_HALT as first argument, should be the last + shutdown: sets INIT_HALT as first argument, should be the last |
I'm wondering if your problem is related to a question I posted (Question #51683).
Upstart has an event that is self-emitted called "startup", that kicks off the boot process, but I fail to see an event that is the opposite of that. A "runlevel 0" event can be used to stop all of the jobs, but I need something at the end that ends up actually rebooting the machine.
It appears that upstart relys on how sysvinit does its shutdown. Basically kill all of the processes, then run SXXkillall and SXXhalt or SXXreboot. The latter two do the actual reboot or halt. But what it I dont have sysvinit doing that? How can I do a reboot or halt without sysvinit's help?