InitScriptStatusActions
6253
Comment: change bind patch status
|
6243
edits to the patch checklist
|
Deletions are marked like this. | Additions are marked like this. |
Line 15: | Line 15: |
* dpkg -S /etc/init.d/FOO 1. Open a Bug in Launchpad against the package |
* {{{ dpkg -S /etc/init.d/FOO }}} 1. Open a bug in Launchpad against the package |
Line 18: | Line 18: |
1. Grab the source * apt-get source FOO * sudo apt-get build-dep FOO |
1. Grab the source and build dependencies * {{{ apt-get source FOO }}} * {{{ sudo apt-get build-dep FOO }}} |
Line 22: | Line 22: |
* debian/*.init * debian/rc |
* {{{ debian/*.init }}} * {{{ debian/rc }}} |
Line 28: | Line 28: |
* if you're sending to Ubuntu * add the changelog entry referencing your Launchpad bug 1. 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 $? |
* add the changelog entry referencing your Launchpad bug, (LP: #999999) 1. Test your patched init script for the new functionality and regressions * {{{ 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 $? }}} |
Line 37: | Line 36: |
* debuild -S | * {{{ debuild -S }}} |
Line 39: | Line 38: |
* debdiff 1. Compare your work to some of the other patches that did similar things. * See the patch for ''atd'': * http://launchpadlibrarian.net/15924139/at.status.debdiff * Or, perhaps have a look at the patch for ''openssh-server'', which passes a pidfile to status_of_proc(): * http://launchpadlibrarian.net/15924489/openssh.status.debdiff * However, some are more complicated than others, such as ''samba'': * http://launchpadlibrarian.net/15925572/samba.status.debdiff 1. Add your patch to the Launchpad bug you filed |
* {{{ debdiff }}} 1. Compare your work to some of the other patches * [http://launchpadlibrarian.net/15924139/at.status.debdiff atd] * [http://launchpadlibrarian.net/15936081/openssh.status.debdiff openssh-server] 1. Add your patch to the Launchpad bug you filed, mark as ''In Progress'' 1. Subscribe ''kirkland'', and (''ubuntu-main-sponsors'' or ''ubuntu-universe-sponsors'') as appropriate |
Background
The LSB suggests that init scripts provide a status action:
DustinKirkland worked with Debian to [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=490095 provide a status_of_proc() method] in /lib/lsb/init-functions, in the [http://packages.qa.debian.org/l/lsb.html lsb-base] library package. This function is fully integrated in Intrepid as of [https://launchpad.net/ubuntu/+source/lsb lsb-3.2-14].
Adding status actions to init scripts
Numerous init scripts should be patched to call status_of_proc() and provide a status action. A simple recipe follows for adding such functionality.
Patch Checklist
When you encounter an init script that lacks a status action:
- Determine the source package
dpkg -S /etc/init.d/FOO
- Open a bug in Launchpad against the package
- Grab the source and build dependencies
apt-get source FOO
sudo apt-get build-dep FOO
- Locate the init script in the source tree, sometimes
debian/*.init
debian/rc
- 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-14
- add the changelog entry referencing your Launchpad bug, (LP: #999999)
- Test your patched init script for the new functionality and regressions
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 $?
- Build a source package
debuild -S
- Generate a patch
debdiff
- Compare your work to some of the other patches
Add your patch to the Launchpad bug you filed, mark as In Progress
Subscribe kirkland, and (ubuntu-main-sponsors or ubuntu-universe-sponsors) as appropriate
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)
- acpid
at: wiki:247091 (FIXED)
bind9: wiki:247084 (Patch submitted, awaiting sponsorship)
- bip - (not in main, but a pet peeve of mine when it goes down, would like a status action)
- bluetooth
- bootlogd
- brltty
cron: wiki:201504 (FIXED)
- dbus
- dhcdbd
dovecot: wiki:247096 (FIXED)
- gdm
- hal
- kdm
- mysql
- mysql-ndb
- mysql-ndb-mgm
- openvpn
openssh: wiki:247103 (FIXED)
- powernowd
- pulseaudio
- rsync
samba: wiki:247087 (Patch submitted, awaiting sponsorship)
- squid
sysklogd: wiki:247106 (FIXED)
- system-tools-backends
- usplash
winbind: wiki:247087 (Patch submitted, awaiting sponsorship)
/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.
- apport - status should look at /proc/sys/kernel/core_pattern
- binfmt-support - status should check update-binfmts --display, perhaps
- checkfs.sh - status could show the time/date/results of the last check
- checkroot.sh - similar to checkfs.sh, perhaps?
- mountoverflowtmp - status could check the tmp mountpoint
- networking - status could check network connectivity
- pcmciautils - status could check lsmod for needed modules
- policykit - status could check directory existence and permissions
- rmnologin - status could check /var/lib/initscripts/nologin
- screen-cleanup - status could check /var/run/screen
- single - status could check if in single user mode or not
- skeleton - the skeleton init script itself should be enhanced to have a status action!
- 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).
- acpi-support
- alsa-utils
- bootmisc.sh
- console-screen.sh
- console-setup
- dns-clean
- glibc.sh
- halt
- hostname.sh
- hotkey-setup
- hwclockfirst.sh
- hwclock.sh
- keyboard-setup
- killprocs
- loopback
- module-init-tools
- mountall-bootclean.sh
- mountall.sh
- mountdevsubfs.sh
- mountkernfs.sh
- mountnfs-bootclean.sh
- mountnfs.sh
- powernowd.early
- pppd-dns
- procps
- rc
- rc.local
- rcS
- readahead
- readahead-desktop
- reboot
- resolvconf
- sendsigs
- stop-bootlogd
- stop-bootlogd-single
- stop-readahead
- umountfs
- umountnfs.sh
- umountroot
- vbesave
- wpa-ifupdown
- xserver-xorg-input-wacom
References
InitScriptStatusActions (last edited 2009-11-29 13:27:58 by 77-21-62-108-dynip)