Differences between revisions 3 and 4
Revision 3 as of 2008-07-03 19:50:19
Size: 2967
Editor: MumiaWotse
Revision 4 as of 2011-08-26 04:10:18
Size: 2967
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Please feel free to comment on any aspect of this page, and add your own arguments for and against.

Should a job that is started manually be stopped automatically?

  • Not having them stopped automatically makes some kind of logical sense; if you started the job by hand, it should be in "manual" mode therefore require being stopped by hand.
  • Code-wise this is simple, we just wouldn't copy config->stop_on into job->stop_on for the instance manually started, and could use this to detect manual vs. automatic for UI purposes.

  • It would solve the problem where a job that is started manually may not have the full environment as a job started automatically, and that full environment is actually required to match the stop events.
  • On the other hand, if you start getty TTY=ttyUSB0 and the serial port goes away, wouldn't it be nice if the getty stopped too?

  • There might even be situations where a job must be stopped on an event (e.g. filesystem going away) for something else to happen.
  • That implies we'd still have to match for the instance anyway, since we'd need to fail events that would otherwise stop it.
  • So that kinda tells us we should stop automatically; but I'm still not sure.

Should you be able to manually start a job that wouldn't be started automatically?

  • Ie. should a job be considered disabled unless the start events and/or state is true.
  • I'm generally inclined to say that a sysadmin should always be able to override Upstart.
  • There's a certain argument for jobs that aren't started automatically, but can define when a sysadmin can start them without forcing though.

Restore Runlevel Control from the Kernel command line

Upstart should support allowing the user to select the default runlevel from the kernel command line. The following script, which is designed for Ubuntu 8.04 (Hardy Heron), allows upstart to set the runlevel based on kernel command line parameters. This script would replace /etc/event.d/rc-default:

# rc - runlevel compatibility
# /etc/event.d/rc-default
# This task guesses what the "default runlevel" should be and starts the
# appropriate script.
# From the kernel command line, specify a desired runlevel by
# writing "init" followed by the runlevel number. For example, you would
# do this for entering runlevel 3:
# kernel /boot/vmlinuz root=/dev/sda1 ro init 3

start on stopped rcS

        runlevel --reboot || true

        RL="$(sed -ne 's/.*init \([2-5S]\).*/\1/p' /proc/cmdline || true)"

        if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
            telinit S
        elif [ -n "$RL" ]; then
            telinit $RL
        elif [ -r /etc/inittab ]; then
            RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
            if [ -n "$RL" ]; then
                telinit $RL
                telinit 2
            telinit 2
end script
# vim: sts=4

OutstandingIssues (last edited 2011-08-26 04:10:18 by localhost)