Influencing upstart from within a job

Jon Stanley jonstanley at
Thu Feb 17 20:18:02 UTC 2011

Sorry that I couldn't find a users list to deal with upstart (but then
again, most users probably don't care too much about the init
system... :D). Anyhow, I'm trying (and I've talked to a few people in
person about this) to influence the behavior of upstart from within an
upstart job. This is on RHEL6, which uses 0.6.5 in mostly
compatibility mode.

To put this in more concrete terms, I have a job that gets run one
time, when a server is first installed. This is done by a very simple
upstart job, and the complexity is in the scripts executed by the job
(basically, I'm using the SysV compatibility wrappers to start a
"runlevel 9". This job is executed at "start on starting rc". When
this job is complete, I need the system to reboot, not continue on
past this job. The job takes care of removing itself on success.

Trying to use /sbin/init 6, for example, within the job fails to do
anything. The only way that I could find to effect a reboot is to use
something like /sbin/reboot -f, but that has the unfortunate side
effect of an unclean reboot.

Am I missing something here, or is there really no good way to do this?

More information about the upstart-devel mailing list