From: Didier Raboud Date: Wed, 9 May 2012 12:43:17 +0000 (+0200) Subject: In init-functions, include hooks from other packages. X-Git-Tag: archive/raspbian/10.2018112800+rpi1^2~137 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0202e4d6fde3ace1a87e9e976627fabaf9e8c1a7;p=lsb.git In init-functions, include hooks from other packages. - Add a /lib/lsb/init-functions.d/ empty directory for this purpose. - Add a lintian override for the above. - Source any file in there. - Document that in lsb-base.README. (This would be used by systemd, at least). Git-Dch: Full --- diff --git a/debian/lsb-base.README.Debian b/debian/lsb-base.README.Debian index 42c1ab3..4c0b9c6 100644 --- a/debian/lsb-base.README.Debian +++ b/debian/lsb-base.README.Debian @@ -198,6 +198,12 @@ Each function receives all of the arguments sent to the parent function; the "pre" functions operate before any output, while the "post" functions operate after the output is produced. +HOOKING INIT-FUNCTIONS + +Since lsb-base 4.1+Debian3+, init-functions will source all files under +/lib/lsb/init-functions.d for the purpose of allowing packages to alter +or enhance the init-functions functions. + FANCY OUTPUT, KNOWN BUGS * Daemons writing too much information on the screen (hence getting diff --git a/debian/lsb-base.dirs b/debian/lsb-base.dirs new file mode 100644 index 0000000..acead11 --- /dev/null +++ b/debian/lsb-base.dirs @@ -0,0 +1 @@ +/lib/lsb/init-functions.d diff --git a/debian/lsb-base.lintian-overrides b/debian/lsb-base.lintian-overrides new file mode 100644 index 0000000..200fe08 --- /dev/null +++ b/debian/lsb-base.lintian-overrides @@ -0,0 +1,2 @@ +# This folder is meant for other packages' hooks. +package-contains-empty-directory lib/lsb/init-functions.d/ diff --git a/init-functions b/init-functions index 3f01189..16bc53e 100644 --- a/init-functions +++ b/init-functions @@ -458,3 +458,8 @@ log_action_end_msg_post () { :; } FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true + +# Include hooks from other packages in /lib/lsb/init-functions.d +for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do + [ -r $hook ] && . $hook || true +done