From cd4becf6cd9611defda298f984efa01c441723d3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 11 Feb 2013 22:13:28 -0500 Subject: make init.sh and init-early.sh honor SYSCONFDIR Fixes hardcoded paths that break when built with SYSCONFDIR set to anything other than /etc/ Signed-off-by: Andrew Gregory --- sh/init-early.sh.Linux.in | 2 +- sh/init.sh.BSD.in | 2 +- sh/init.sh.Linux.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sh') diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in index f9d23889..ba1da984 100644 --- a/sh/init-early.sh.Linux.in +++ b/sh/init-early.sh.Linux.in @@ -7,7 +7,7 @@ service_present() { - local p="/etc/runlevels/$1/$2" + local p="@SYSCONFDIR@/runlevels/$1/$2" # fail if the file doesn't exist [ ! -e "$p" ] && return 1 # succeed if $RC_SYS empty, can't check further, assume script will run diff --git a/sh/init.sh.BSD.in b/sh/init.sh.BSD.in index 25b46a4d..0bd3e9bc 100644 --- a/sh/init.sh.BSD.in +++ b/sh/init.sh.BSD.in @@ -22,7 +22,7 @@ mount_svcdir() } . "$RC_LIBEXECDIR"/sh/functions.sh -[ -r /etc/rc.conf ] && . /etc/rc.conf +[ -r "@SYSCONFDIR@/rc.conf" ] && . "@SYSCONFDIR@/rc.conf" # Disable devd until we need it if [ -z "$RC_SYS" -a "$RC_UNAME" = "FreeBSD" ]; then diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in index ed81a9ea..09bcbdb6 100644 --- a/sh/init.sh.Linux.in +++ b/sh/init.sh.Linux.in @@ -4,7 +4,7 @@ # Released under the 2-clause BSD license. . "$RC_LIBEXECDIR"/sh/functions.sh -[ -r /etc/rc.conf ] && . /etc/rc.conf +[ -r "@SYSCONFDIR@/rc.conf" ] && . "@SYSCONFDIR@/rc.conf" # By default VServer already has /proc mounted, but OpenVZ does not! # However, some of our users have an old proc image in /proc -- cgit v1.2.3