From b8e558d5784c8054a91dcefd8495b739a664dbae Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 28 Nov 2007 14:47:09 -0600 Subject: [PATCH] Source /etc/rc.d/functions.d/ for additional initscript functions Signed-off-by: Aaron Griffin --- functions | 8 ++++++++ install.sh | 1 + rc.multi | 2 ++ rc.single | 2 ++ rc.sysinit | 2 ++ 5 files changed, 15 insertions(+), 0 deletions(-) diff --git a/functions b/functions index 8b5ecf1..1cefa0b 100644 --- a/functions +++ b/functions @@ -142,5 +142,13 @@ ck_daemon() { return 0 } +source_functions() { + if [ -d /etc/rc.d/functions.d/ ]; then + for f in /etc/rc.d/functions.d/*; do + . $f + done + fi +} + # End of file # vim: set ts=2 noet: diff --git a/install.sh b/install.sh index 6d5b2dc..070289a 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,7 @@ #!/bin/sh install -d -m755 ${DESTDIR}/etc/{rc.d,conf.d} || exit 1 +install -d -m755 ${DESTDIR}/etc/rc.d/functions.d/ || exit 1 for i in inittab rc.conf; do install -D -m644 $i ${DESTDIR}/etc/$i || exit 1 diff --git a/rc.multi b/rc.multi index 8050e98..678b50e 100755 --- a/rc.multi +++ b/rc.multi @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +source_functions + # Load sysctl variables if sysctl.conf is present [ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null diff --git a/rc.single b/rc.single index 0d3581b..5f55eeb 100755 --- a/rc.single +++ b/rc.single @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +source_functions + if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Shutdown daemons let i=${#DAEMONS[@]} diff --git a/rc.sysinit b/rc.sysinit index bad17d2..3bf8edc 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -6,6 +6,8 @@ . /etc/rc.conf . /etc/rc.d/functions +source_functions + echo " " printhl "Arch Linux $C_OTHER(${C_H2}Core Dump$C_OTHER)\n" printhl "${C_H2}http://www.archlinux.org" -- 1.5.3.6