In init-functions, include hooks from other packages.
authorDidier Raboud <odyx@debian.org>
Wed, 9 May 2012 12:43:17 +0000 (14:43 +0200)
committerDidier Raboud <odyx@debian.org>
Wed, 9 May 2012 13:20:50 +0000 (15:20 +0200)
- 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

debian/lsb-base.README.Debian
debian/lsb-base.dirs [new file with mode: 0644]
debian/lsb-base.lintian-overrides [new file with mode: 0644]
init-functions

index 42c1ab38213d94ebc662b1924351b8f5ba8ba789..4c0b9c6b05a7415ff7696f764de202e2b0c6cefc 100644 (file)
@@ -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 (file)
index 0000000..acead11
--- /dev/null
@@ -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 (file)
index 0000000..200fe08
--- /dev/null
@@ -0,0 +1,2 @@
+# This folder is meant for other packages' hooks.
+package-contains-empty-directory lib/lsb/init-functions.d/
index 3f011899a72ee4a058d86536f403c117a49d23ac..16bc53e8a872c12f559005c3283bf1d89763058c 100644 (file)
@@ -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