InitScriptStatusActions

Revision 10 as of 2008-07-22 22:25:05

Clear message

Overview

The LSB suggests that init scripts provide a status action:

status_of_proc() library function in lsb-base

DustinKirkland has worked with Debian to provide a status_of_proc() method in /lib/lsb/init-functions, which is provided by the lsb-base package. This function is fully integrated in Debian's lsb-3.2-14:

various init script callers

DustinKirkland has provided patches to the key service init scripts that are installable from the Ubuntu Server CD:

OnnoBenschop has provided a script to detect, and compiled a list of init scripts that are lacking status action here:

Countless other init scripts could/should be patched to provide this functionality.

Patch Checklist

When you encounter an init script that lacks a status action:

  1. Determine the source package
    • dpkg -S /etc/init.d/FOO
  2. Open a Bug in Launchpad against the package
  3. Grab the source
    • apt-get source FOO
    • sudo apt-get build-dep FOO
  4. Locate the init script in the source tree, often:
    • debian/*.init
    • debian/rc
  5. Patch the source to
    • have the init script call status_of_proc()
    • have the init script add "status" to the usage statement
    • add a dependency in debian/control for lsb-base >= 3.2-12ubuntu3

    • if you're sending to Ubuntu
      • add the changelog entry referencing your Launchpad bug
  6. Test your patched init script
    • sh debian/FOO.init status
    • echo $?
    • sudo sh debian/FOO.init stop
    • sh debian/FOO.init status
    • echo $?
    • sudo sh debian/FOO.init start
    • sh debian/FOO.init status
    • echo $?
  7. Build a source package
    • debuild -S
  8. Generate a patch
    • debdiff
  9. Compare your work to some of the other patches that did similar things.
  10. Add your patch to the Launchpad bug you filed

Init Scripts that Need a Status Action

The following is a crude list of init scripts in Intrepid that are lacking a "status" action. I say "crude" in that this list was generated on 2008-07-21 by installing the Intrepid Ubuntu (server, ubuntu-desktop, kubuntu-desktop, xubuntu-desktop), and grepping through /etc/init.d for scripts that lacked the string "status)". Please help improve this list by adding/removing init scripts to/from this list, and linking to a bug number. Please leave an informative note in this wiki page's changelog.

You can run dpkg -S /etc/init.d/... to determine the source package of any of the following scripts.

/etc/init.d/... init scripts with associated daemon(s)

  1. acpid
  2. bluetooth
  3. bootlogd
  4. brltty
  5. dbus
  6. dhcdbd
  7. gdm
  8. hal
  9. kdm
  10. mountall-bootclean.sh
  11. mountall.sh
  12. mountdevsubfs.sh
  13. mountkernfs.sh
  14. mountnfs-bootclean.sh
  15. mountnfs.sh
  16. mountoverflowtmp
  17. mtab.sh
  18. mysql
  19. mysql-ndb
  20. mysql-ndb-mgm
  21. networking
  22. openvpn
  23. pcmciautils
  24. policykit
  25. powernowd
  26. powernowd.early
  27. pppd-dns
  28. procps
  29. pulseaudio
  30. rc
  31. rc.local
  32. rcS
  33. readahead
  34. readahead-desktop
  35. reboot
  36. resolvconf
  37. rmnologin
  38. rsync
  39. screen-cleanup
  40. sendsigs
  41. single
  42. skeleton
  43. stop-bootlogd
  44. stop-bootlogd-single
  45. stop-readahead
  46. system-tools-backends
  47. udev
  48. udev-finish
  49. umountfs
  50. umountnfs.sh
  51. umountroot
  52. urandom
  53. usplash
  54. vbesave
  55. winbind
  56. wpa-ifupdown
  57. xserver-xorg-input-wacom

/etc/init.d/... Non-daemon init scripts

No daemon, but detectable status

  1. apport - no daemon, status should look at /proc/sys/kernel/core_pattern
  2. binfmt-support - no daemon, status should check update-binfmts --display, perhaps
  3. checkfs.sh - no daemon, but status could show the time/date/results of the last check
  4. checkroot.sh - no daemon, but similar to checkfs.sh, perhaps?

No daemon

  1. acpi-support
  2. alsa-utils
  3. bootmisc.sh
  4. console-screen.sh
  5. console-setup
  6. dns-clean
  7. glibc.sh
  8. halt
  9. hostname.sh
  10. hotkey-setup
  11. hwclockfirst.sh
  12. hwclock.sh
  13. keyboard-setup
  14. killprocs
  15. loopback
  16. module-init-tools