InitScriptStatusActions

Differences between revisions 10 and 12 (spanning 2 versions)
Revision 10 as of 2008-07-22 22:25:05
Size: 5160
Editor: cpe-66-68-158-133
Comment: editing list of init scripts (increment save)
Revision 12 as of 2008-07-23 16:50:35
Size: 6181
Editor: dsl-64-56-231-198
Comment:
Deletions are marked like this. Additions are marked like this.
Line 77: Line 77:
 1. bip - (not in main, but a pet peeve of mine when it goes down, would like a status action)
Line 85: Line 86:
 1. mountall-bootclean.sh
 1. mountall.sh
 1. mountdevsubfs.sh
 1. mountkernfs.sh
 1. mountnfs-bootclean.sh
 1. mountnfs.sh
 1. mountoverflowtmp
 1. mtab.sh
Line 96: Line 89:
 1. networking
Line 98: Line 90:
 1. pcmciautils
 1. policykit
Line 101: Line 91:
 1. powernowd.early
 1. pppd-dns
 1. procps
Line 105: Line 92:
 1. rc
 1. rc.local
 1. rcS
 1. readahead
 1. readahead-desktop
 1. reboot
 1. resolvconf
 1. rmnologin
Line 114: Line 93:
 1. screen-cleanup
 1. sendsigs
 1. single
 1. skeleton
 1. stop-bootlogd
 1. stop-bootlogd-single
 1. stop-readahead
 1. squid
Line 122: Line 95:
 1. udev
 1. udev-finish
 1. umountfs
 1. umountnfs.sh
 1. umountroot
 1. urandom
Line 129: Line 96:
 1. vbesave
 1. winbind
 1. wpa-ifupdown
 1. xserver-xorg-input-wacom
 1. winbind - patches pending (wiki:Bug:247087)
Line 134: Line 98:
== /etc/init.d/... Non-daemon init scripts == === /etc/init.d/... Non-daemon init scripts ===
Line 136: Line 100:
=== No daemon, but detectable status ===
 1. apport - no daemon, status should look at /proc/sys/kernel/core_pattern
 1. binfmt-support - no daemon, status should check update-binfmts --display, perhaps
 1. checkfs.sh - no daemon, but status could show the time/date/results of the last check
 1. checkroot.sh - no daemon, but similar to checkfs.sh, perhaps?
==== No daemon, but detectable status ====
The following init scripts do not have an associated daemon, however, they do perform actions on the system which could be algorithmically checked. I'm noting some suggested items that could be checked in a 'status' action.
Line 142: Line 103:
=== No daemon ===  1. apport - status should look at /proc/sys/kernel/core_pattern
 1. binfmt-support - status should check update-binfmts --display, perhaps
 1. checkfs.sh - status could show the time/date/results of the last check
 1. checkroot.sh - similar to checkfs.sh, perhaps?
 1. mountoverflowtmp - status could check the tmp mountpoint
 1. networking - status could check network connectivity
 1. pcmciautils - status could check lsmod for needed modules
 1. policykit - status could check directory existence and permissions
 1. rmnologin - status could check /var/lib/initscripts/nologin
 1. screen-cleanup - status could check /var/run/screen
 1. single - status could check if in single user mode or not
 1. skeleton - the skeleton init script itself should be enhanced to have a status action!
 1. urandom - status could check /dev/urandom


==== No daemon ====
The following init scripts do not have an associated deamon. On initial review of the code, a 'status' action for these scripts does not necessarily make sense. If you have an idea of a sensible status action, please note the suggestion and move the item to the list above (detectable status).
Line 159: Line 137:
 1. mountall-bootclean.sh
 1. mountall.sh
 1. mountdevsubfs.sh
 1. mountkernfs.sh
 1. mountnfs-bootclean.sh
 1. mountnfs.sh
 1. powernowd.early
 1. pppd-dns
 1. procps
 1. rc
 1. rc.local
 1. rcS
 1. readahead
 1. readahead-desktop
 1. reboot
 1. resolvconf
 1. sendsigs
 1. stop-bootlogd
 1. stop-bootlogd-single
 1. stop-readahead
 1. umountfs
 1. umountnfs.sh
 1. umountroot
 1. vbesave
 1. wpa-ifupdown
 1. xserver-xorg-input-wacom

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. bip - (not in main, but a pet peeve of mine when it goes down, would like a status action)
  3. bluetooth
  4. bootlogd
  5. brltty
  6. dbus
  7. dhcdbd
  8. gdm
  9. hal
  10. kdm
  11. mysql
  12. mysql-ndb
  13. mysql-ndb-mgm
  14. openvpn
  15. powernowd
  16. pulseaudio
  17. rsync
  18. squid
  19. system-tools-backends
  20. usplash
  21. winbind - patches pending (wiki:247087)

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

No daemon, but detectable status

The following init scripts do not have an associated daemon, however, they do perform actions on the system which could be algorithmically checked. I'm noting some suggested items that could be checked in a 'status' action.

  1. apport - status should look at /proc/sys/kernel/core_pattern
  2. binfmt-support - status should check update-binfmts --display, perhaps
  3. checkfs.sh - status could show the time/date/results of the last check
  4. checkroot.sh - similar to checkfs.sh, perhaps?
  5. mountoverflowtmp - status could check the tmp mountpoint
  6. networking - status could check network connectivity
  7. pcmciautils - status could check lsmod for needed modules
  8. policykit - status could check directory existence and permissions
  9. rmnologin - status could check /var/lib/initscripts/nologin
  10. screen-cleanup - status could check /var/run/screen
  11. single - status could check if in single user mode or not
  12. skeleton - the skeleton init script itself should be enhanced to have a status action!
  13. urandom - status could check /dev/urandom

No daemon

The following init scripts do not have an associated deamon. On initial review of the code, a 'status' action for these scripts does not necessarily make sense. If you have an idea of a sensible status action, please note the suggestion and move the item to the list above (detectable status).

  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
  17. mountall-bootclean.sh
  18. mountall.sh
  19. mountdevsubfs.sh
  20. mountkernfs.sh
  21. mountnfs-bootclean.sh
  22. mountnfs.sh
  23. powernowd.early
  24. pppd-dns
  25. procps
  26. rc
  27. rc.local
  28. rcS
  29. readahead
  30. readahead-desktop
  31. reboot
  32. resolvconf
  33. sendsigs
  34. stop-bootlogd
  35. stop-bootlogd-single
  36. stop-readahead
  37. umountfs
  38. umountnfs.sh
  39. umountroot
  40. vbesave
  41. wpa-ifupdown
  42. xserver-xorg-input-wacom

InitScriptStatusActions (last edited 2009-11-29 13:27:58 by 77-21-62-108-dynip)