InitScriptStatusActions
2881
Comment: initial creation
|
5160
editing list of init scripts (increment save)
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
== Overview == | = Overview = |
Line 6: | Line 6: |
=== status_of_proc() library function in lsb-base == | == status_of_proc() library function in lsb-base == |
Line 8: | Line 8: |
DustinKirkland has been working 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 present as of lsb-3.2-13: | 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: |
Line 12: | Line 12: |
In the meantime, this functionality has been merged into Ubuntu's lsb-base package in lsb 3.2-12ubuntu3: * https://launchpad.net/ubuntu/intrepid/+source/lsb/3.2-12ubuntu3 This diff should be dropped as soon as Debian accepts the functionality and Ubuntu merges the package into Intrepid. |
|
Line 29: | Line 25: |
* OnnoBenschop/ubuntu-server/init.d-status | * https://wiki.ubuntu.com/OnnoBenschop/ubuntu-server/init.d-status |
Line 48: | Line 44: |
* add a dependency in debian/control for lsb >= 3.2-12ubuntu3 | * add a dependency in debian/control for lsb-base >= 3.2-12ubuntu3 |
Line 51: | Line 47: |
* don't if you're sending to Debian! | 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 $? |
Line 64: | Line 68: |
== 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 1. bluetooth 1. bootlogd 1. brltty 1. dbus 1. dhcdbd 1. gdm 1. hal 1. kdm 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 1. mysql 1. mysql-ndb 1. mysql-ndb-mgm 1. networking 1. openvpn 1. pcmciautils 1. policykit 1. powernowd 1. powernowd.early 1. pppd-dns 1. procps 1. pulseaudio 1. rc 1. rc.local 1. rcS 1. readahead 1. readahead-desktop 1. reboot 1. resolvconf 1. rmnologin 1. rsync 1. screen-cleanup 1. sendsigs 1. single 1. skeleton 1. stop-bootlogd 1. stop-bootlogd-single 1. stop-readahead 1. system-tools-backends 1. udev 1. udev-finish 1. umountfs 1. umountnfs.sh 1. umountroot 1. urandom 1. usplash 1. vbesave 1. winbind 1. wpa-ifupdown 1. 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 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 === 1. acpi-support 1. alsa-utils 1. bootmisc.sh 1. console-screen.sh 1. console-setup 1. dns-clean 1. glibc.sh 1. halt 1. hostname.sh 1. hotkey-setup 1. hwclockfirst.sh 1. hwclock.sh 1. keyboard-setup 1. killprocs 1. loopback 1. module-init-tools |
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:
at: wiki:247091
bind9: wiki:247084
cron: wiki:201504
dovecot: wiki:247096
openssh: wiki:247103
samba: wiki:247087
syslogkd: wiki:247106
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:
- Determine the source package
- dpkg -S /etc/init.d/FOO
- Open a Bug in Launchpad against the package
- Grab the source
- apt-get source FOO
- sudo apt-get build-dep FOO
- Locate the init script in the source tree, often:
- 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-12ubuntu3
- if you're sending to Ubuntu
- add the changelog entry referencing your Launchpad bug
- 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 $?
- Build a source package
- debuild -S
- Generate a patch
- debdiff
- Compare your work to some of the other patches that did similar things.
See the patch for atd:
Or, perhaps have a look at the patch for openssh-server, which passes a pidfile to status_of_proc():
However, some are more complicated than others, such as samba:
- 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)
- acpid
- bluetooth
- bootlogd
- brltty
- dbus
- dhcdbd
- gdm
- hal
- kdm
- mountall-bootclean.sh
- mountall.sh
- mountdevsubfs.sh
- mountkernfs.sh
- mountnfs-bootclean.sh
- mountnfs.sh
- mountoverflowtmp
- mtab.sh
- mysql
- mysql-ndb
- mysql-ndb-mgm
- networking
- openvpn
- pcmciautils
- policykit
- powernowd
- powernowd.early
- pppd-dns
- procps
- pulseaudio
- rc
- rc.local
- rcS
- readahead
- readahead-desktop
- reboot
- resolvconf
- rmnologin
- rsync
- screen-cleanup
- sendsigs
- single
- skeleton
- stop-bootlogd
- stop-bootlogd-single
- stop-readahead
- system-tools-backends
- udev
- udev-finish
- umountfs
- umountnfs.sh
- umountroot
- urandom
- usplash
- vbesave
- winbind
- wpa-ifupdown
- xserver-xorg-input-wacom
/etc/init.d/... Non-daemon init scripts
No daemon, but detectable status
- apport - no daemon, status should look at /proc/sys/kernel/core_pattern
- binfmt-support - no daemon, status should check update-binfmts --display, perhaps
- checkfs.sh - no daemon, but status could show the time/date/results of the last check
- checkroot.sh - no daemon, but similar to checkfs.sh, perhaps?
No daemon
- 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
InitScriptStatusActions (last edited 2009-11-29 13:27:58 by 77-21-62-108-dynip)