Here is the patch with the typo fixed and my changelog entry.
--- a/debian/changelog 2025-11-16 09:46:32.000000000 +0100
+++ b/debian/changelog 2025-11-17 17:15:35.000000000 +0100
@@ -1,3 +1,23 @@
+sysvinit (3.15-6.1) UNRELEASED; urgency=medium
+
+ * debian/src/initscripts/:
+ - etc/init.d/*.sh, bootlogs, urandom: Add /usr/{sbin,bin} to PATH.
+ Remove hardcoded paths.
+ - etc/init.d/udev: Remove hardcoded paths and use "which true" instead of
+ "command -v true".
+ - etc/network/if-up.d/mountnfs: Add /usr/{sbin,bin} to PATH.
+ Remove hardcoded paths.
+ - lib/init/bootclean.sh: Add /usr/{sbin,bin} to PATH and remove hardcoded paths.
+ - lib/init/mount-functions.sh: Add PATH and add "command -v file"
+ to avoid hardcoded paths.
+ * debian/src/bootlogd/etc/init.d:
+ - bootlogd: Add /usr/{sbin,bin} to PATH.
+ - *bootlogd*: Replace hardcoded path for DAEMON with "command -v".
+ * debian/src/lsb-base/init-functions: Add PATH and add "command -v file"
+ to avoid hardcoded paths.
+
+ -- Svante Signell <svante.signell@???> Sat, 25 Oct 2025 10:28:27 +0200
+
sysvinit (3.15-6) unstable; urgency=medium
[ Mark Hindley ]
Index: sysvinit-3.15/debian/vars.sh
===================================================================
--- sysvinit-3.15.orig/debian/vars.sh
+++ sysvinit-3.15/debian/vars.sh
@@ -12,6 +12,7 @@ UTC=yes
VERBOSE=no
FSCKFIX=no
+PATH=/usr/sbin:/sbin:/usr/bin:/bin
# Source conffile
if [ -f /etc/default/rcS ]; then
. /etc/default/rcS
Index: sysvinit-3.15/debian/src/initscripts/lib/init/bootclean.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/lib/init/bootclean.sh
+++ sysvinit-3.15/debian/src/initscripts/lib/init/bootclean.sh
@@ -6,6 +6,7 @@
# in runlevel S. Instead write an initscript to call it.
#
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
@@ -30,7 +31,7 @@ mkflagfile() {
checkflagfile() {
if [ -f $1/.clean ]; then
- which stat >/dev/null 2>&1 && cleanuid="$(stat -c %u $1/.clean)"
+ command -v stat >/dev/null 2>&1 && cleanuid="$(stat -c %u $1/.clean)"
# Poor's man stat %u, since stat (and /usr) might not
# be available in some bootup stages
[ "$cleanuid" ] || cleanuid="$(find $1/.clean -printf %U)"
@@ -75,7 +76,7 @@ clean_tmp() {
# Already cleaned
[ -f /tmp/.clean ] && return 0
# Can't clean yet?
- which find >/dev/null 2>&1 || return 1
+ command -v find >/dev/null 2>&1 || return 1
cd /tmp || {
log_failure_msg "bootclean: Could not cd to /tmp."
@@ -176,7 +177,7 @@ clean() {
# Already cleaned
[ -f "${dir}/.clean" ] && return 0
# Can't clean yet?
- which find >/dev/null 2>&1 || return 1
+ command -v find >/dev/null 2>&1 || return 1
cd "$dir" || {
log_action_end_msg 1 "bootclean: Could not cd to ${dir}."
@@ -197,7 +198,7 @@ clean() {
}
clean_all() {
- which find >/dev/null 2>&1 || return 0
+ command -v find >/dev/null 2>&1 || return 0
log_begin_msg "Cleaning up temporary files..."
ES=0
clean_tmp || ES=1
Index: sysvinit-3.15/debian/src/bootlogd/etc/init.d/bootlogd
===================================================================
--- sysvinit-3.15.orig/debian/src/bootlogd/etc/init.d/bootlogd
+++ sysvinit-3.15/debian/src/bootlogd/etc/init.d/bootlogd
@@ -11,8 +11,8 @@
# which logs boot messages.
### END INIT INFO
-PATH=/sbin:/bin # No remote fs at start
-DAEMON=/sbin/bootlogd
+PATH=/usr/sbin:/sbin:/sbin:/bin # No remote fs at start
+DAEMON=`command -v bootlogd`
TMPLOG=/run/bootlog
[ -x "$DAEMON" ] || exit 0
NAME=bootlogd
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/bootlogs
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/bootlogs
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/bootlogs
@@ -30,7 +30,7 @@ do_start() {
fi
# Save kernel messages in /var/log/dmesg
- if which dmesg >/dev/null 2>&1; then
+ if "`command -v dmesg`" >/dev/null 2>&1; then
dmesg -s 524288 >/var/log/dmesg
elif [ -c /dev/klog ]; then
dd if=/dev/klog of=/var/log/dmesg &
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/bootmisc.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/bootmisc.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/bootmisc.sh
@@ -35,7 +35,7 @@ do_start() {
if >"${utmp}"; then
chgrp utmp "${utmp}" || log_warning_msg "failed to chgrp ${utmp}"
chmod 664 "${utmp}" || log_warning_msg "failed to chmod ${utmp}"
- [ -x /sbin/restorecon ] && /sbin/restorecon "${utmp}"
+ [ -x "`command -v restorecon`" ] && restorecon "${utmp}"
return 0
else
log_failure_msg "failed to truncate ${utmp}"
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/checkfs.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/checkfs.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/checkfs.sh
@@ -10,7 +10,7 @@
# Short-Description: Check all filesystems.
### END INIT INFO
-PATH=/sbin:/bin
+PATH=/usr/sbin:/sbin:/sbin:/bin
FSCK_LOGFILE=/var/log/fsck/checkfs
[ "$FSCKFIX" ] || FSCKFIX=no
. /lib/init/vars.sh
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/checkroot-bootclean.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/checkroot-bootclean.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/checkroot-bootclean.sh
@@ -13,6 +13,7 @@
# masked by future mounts may be cleaned.
### END INIT INFO
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/init/bootclean.sh
case "$1" in
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/checkroot.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/checkroot.sh
@@ -11,7 +11,7 @@
# Short-Description: Check to root file system.
### END INIT INFO
-PATH=/sbin:/bin
+PATH=/usr/sbin:/sbin:/usr/bin:/bin
FSCK_LOGFILE=/var/log/fsck/checkroot
[ "$FSCKFIX" ] || FSCKFIX=no
[ "$SULOGIN" ] || SULOGIN=no
@@ -144,7 +144,7 @@ Will restart in 5 seconds."
if [ -e /run/initramfs/fsck-root ]; then
rootcheck=no
# logsave_best_effort but do not display again
- if [ -x /sbin/logsave ]; then
+ if [ -x "`command -v logsave`" ]; then
logsave -s "${FSCK_LOGFILE}" \
cat /run/initramfs/fsck.log >/dev/null
else
@@ -157,7 +157,7 @@ Will restart in 5 seconds."
rootcheck=no
fi
- if which findmnt >/dev/null 2>&1; then
+ if `command -v findmnt` >/dev/null 2>&1; then
if [ "$(findmnt -f -n -o FSTYPE /)" = "btrfs" ]; then
[ "$rootcheck" = yes ] && log_warning_msg "btrfs root detected, so skipping root file system check."
rootcheck=no
@@ -286,7 +286,7 @@ but requested that the system be restart
mtab_migrate
fi
- if selinux_enabled && [ -x /sbin/restorecon ] && [ -r /etc/mtab ]; then
+ if selinux_enabled && [ -x "`command -v restorecon`" ] && [ -r /etc/mtab ]; then
restorecon /etc/mtab
fi
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/hostname.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/hostname.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/hostname.sh
@@ -11,7 +11,7 @@
# update the kernel value with this value.
### END INIT INFO
-PATH=/sbin:/bin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/hwclock.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/hwclock.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/hwclock.sh
@@ -13,6 +13,7 @@
# Note: this init script and related code is only useful if you
# run a sysvinit system, without NTP synchronization.
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [ -e /run/systemd/system ]; then
exit 0
fi
@@ -21,7 +22,7 @@ unset TZ
hwclocksh() {
HCTOSYS_DEVICE=rtc0
- [ ! -x /sbin/hwclock ] && return 0
+ [ ! -x hwclock ] && return 0
[ ! -r /etc/default/rcS ] || . /etc/default/rcS
[ ! -r /etc/default/hwclock ] || . /etc/default/hwclock
@@ -39,10 +40,10 @@ hwclocksh() {
# for example by the Linux kernel when NTP is in use.
if [ "$(uname -s)" = GNU ]; then
log_action_msg "Saving the system clock to CMOS"
- /sbin/hwclock --directisa --systohc
+ hwclock --directisa --systohc
else
log_action_msg "Saving the system clock to /dev/$HCTOSYS_DEVICE"
- /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc
+ hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc
fi
if [ $? -eq 0 ]; then
verbose_log_action_msg "Hardware Clock updated to $(date)"
@@ -51,9 +52,9 @@ hwclocksh() {
;;
show)
if [ "$(uname -s)" = GNU ]; then
- /sbin/hwclock --directisa --show
+ hwclock --directisa --show
else
- /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show
+ hwclock --rtc=/dev/$HCTOSYS_DEVICE --show
fi
;;
*)
Index: sysvinit-3.15/debian/src/lsb-base/init-functions
===================================================================
--- sysvinit-3.15.orig/debian/src/lsb-base/init-functions
+++ sysvinit-3.15/debian/src/lsb-base/init-functions
@@ -27,6 +27,8 @@
#OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
start_daemon () {
local force nice pidfile exec args OPTIND
force=""
@@ -51,13 +53,13 @@ start_daemon () {
args="--start --nicelevel $nice --quiet --oknodo"
if [ "$force" ]; then
- /sbin/start-stop-daemon $args \
+ start-stop-daemon $args \
--chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@"
elif [ $pidfile ]; then
- /sbin/start-stop-daemon $args \
+ start-stop-daemon $args \
--chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@"
else
- /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@"
+ start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@"
fi
}
@@ -105,9 +107,9 @@ pidofproc () {
fi
else
# pid file doesn't exist, try to find the pid nevertheless
- if [ -x /bin/pidof ] && [ ! "$specified" ]; then
+ if [ -x "`command -v pidof`" ] && [ ! "$specified" ]; then
status="0"
- /bin/pidof -c -o %PPID -x $1 || status="$?"
+ pidof -c -o %PPID -x $1 || status="$?"
if [ "$status" = 1 ]; then
return 3 # program is not running
fi
@@ -151,15 +153,15 @@ killproc () {
status=0
if [ ! "$is_term_sig" ]; then
if [ -n "$sig" ]; then
- /sbin/start-stop-daemon --stop --signal "$sig" \
+ start-stop-daemon --stop --signal "$sig" \
--quiet $name_param || status="$?"
else
- /sbin/start-stop-daemon --stop \
+ start-stop-daemon --stop \
--retry 5 \
--quiet $name_param || status="$?"
fi
else
- /sbin/start-stop-daemon --stop --quiet \
+ start-stop-daemon --stop --quiet \
--oknodo $name_param || status="$?"
fi
if [ "$status" = 1 ]; then
@@ -262,7 +264,7 @@ get_lsb_header_val () {
# upstart job, it should generally exit non-zero in this case.
init_is_upstart()
{
- if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then
+ if [ -x "`command -v initctl`" ] && initctl version 2>/dev/null | grep -q upstart; then
return 0
fi
return 1
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/mount-configfs
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/mount-configfs
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/mount-configfs
@@ -12,7 +12,7 @@
### END INIT INFO
set -eu
-export PATH=/usr/bin:/bin
+export PATH=/usr/sbin:/usr/bin:/sbin:/bin
case ${1:-missing} in
start | restart | force-reload)
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/mountall.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/mountall.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/mountall.sh
@@ -9,7 +9,7 @@
# Description:
### END INIT INFO
-PATH=/sbin:/bin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/init/vars.sh
. /lib/init/tmpfs.sh
@@ -63,7 +63,7 @@ do_start() {
mknod -m 600 "$INITCTL" p
# Reopen control channel.
- PID="$(pidof -s /sbin/init || echo 1)"
+ PID="$(pidof -s init || echo 1)"
[ -n "$PID" ] && kill -s USR1 "$PID"
fi
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/mountdevsubfs.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/mountdevsubfs.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/mountdevsubfs.sh
@@ -15,7 +15,7 @@
# This script gets called multiple times during boot
#
-PATH=/sbin:/bin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
TTYGRP=5
TTYMODE=620
[ -f /etc/default/devpts ] && . /etc/default/devpts
@@ -54,7 +54,7 @@ mount_filesystems() {
if [ "$KERNEL" = Linux ]; then
if [ ! -d /dev/pts ]; then
mkdir --mode=755 /dev/pts
- [ -x /sbin/restorecon ] && /sbin/restorecon /dev/pts
+ [ -x "`command -v restorecon`" ] && restorecon /dev/pts
fi
domount "$MNTMODE" devpts "" /dev/pts devpts "-onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE"
fi
Index: sysvinit-3.15/debian/src/initscripts/lib/init/mount-functions.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/lib/init/mount-functions.sh
+++ sysvinit-3.15/debian/src/initscripts/lib/init/mount-functions.sh
@@ -3,6 +3,8 @@
#
# Sourcer must source /lib/lsb/init-functions.sh
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
# List available fstab files, including any files in /etc/fstab.d.
# This looks ugly, but we can't use find and it's safer than globbing.
fstab_files() {
@@ -25,7 +27,7 @@ is_empty_dir() {
}
selinux_enabled() {
- which selinuxenabled >/dev/null 2>&1 && selinuxenabled
+ command -v selinuxenabled >/dev/null 2>&1 && selinuxenabled
}
# Read /etc/fstab, looking for:
@@ -55,7 +57,7 @@ _read_fstab() {
;;
/dev/*) ;;
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
- if [ "$MTPT" = "/" ] && [ -x /sbin/findfs ]; then
+ if [ "$MTPT" = "/" ] && [ -x "`command -v findfs`" ]; then
DEV="$(findfs "$DEV")"
fi
;;
@@ -279,8 +281,8 @@ domount() {
fi
mount $MOUNTFLAGS -t $FSTYPE $CALLER_OPTS $FSTAB_OPTS $FS_OPTS $DEVNAME $MTPT
status=$?
- if [ "$FSTYPE" = "tmpfs" ] && [ -x /sbin/restorecon ]; then
- /sbin/restorecon $MTPT
+ if [ "$FSTYPE" = "tmpfs" ] && [ -x "`command -v restorecon`" ]; then
+ restorecon $MTPT
fi
fi
;;
@@ -315,8 +317,8 @@ bind_mount() {
FSTYPE=""
OPTS=""
- ssrc="$(/usr/bin/stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
- sdest="$(/usr/bin/stat -L --format="%d %i" "$DEST" 2>/dev/null || :)"
+ ssrc="$(stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
+ sdest="$(stat -L --format="%d %i" "$DEST" 2>/dev/null || :)"
case "$(uname -s)" in
Linux)
@@ -334,7 +336,7 @@ bind_mount() {
# Bind mount $SRC on $DEST
if [ -n "$ssrc" ] && [ "$ssrc" != "$sdest" ]; then
[ -d "$DEST" ] || mkdir "$DEST"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$DEST"
+ [ -x "`command -v restorecon`" ] && restorecon "$DEST"
if mount -t $FSTYPE "$SRC" "$DEST" $OPTS; then
echo "Please reboot to complete migration to tmpfs-based /run" >"${DEST}/.run-transition"
return 0
@@ -369,13 +371,13 @@ run_migrate() {
if [ -L "$OLD" ] && [ "$(readlink "$OLD")" != "$RUN" ]; then
rm -f "$OLD"
ln -fs "$RUN" "$OLD"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$OLD"
+ [ -x "`command -v restorecon`" ] && restorecon "$OLD"
fi
# If both directories are the same, we don't need to do
# anything further.
- sold="$(/usr/bin/stat -L --format="%d %i" "$OLD" 2>/dev/null || :)"
- srun="$(/usr/bin/stat -L --format="%d %i" "$RUN" 2>/dev/null || :)"
+ sold="$(stat -L --format="%d %i" "$OLD" 2>/dev/null || :)"
+ srun="$(stat -L --format="%d %i" "$RUN" 2>/dev/null || :)"
if [ -n "$sold" ] && [ "$sold" = "$srun" ]; then
return 0
fi
@@ -405,7 +407,7 @@ run_migrate() {
else
rm -f "$OLD"
ln -fs "$RUN" "$OLD"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$OLD"
+ [ -x "`command -v restorecon`" ] && restorecon "$OLD"
fi
fi
@@ -429,7 +431,7 @@ mtab_migrate() {
rm -f "/etc/mtab" || return 1
ln -fs "/proc/mounts" "/etc/mtab" || return 1
- [ -x /sbin/restorecon ] && /sbin/restorecon "/etc/mtab"
+ [ -x "`command -v restorecon`" ] && restorecon "/etc/mtab"
fi
return 0
@@ -518,7 +520,7 @@ mount_run() {
fi
# TODO: Add -onodev once checkroot no longer creates a device node.
domount "$MNTMODE" tmpfs shmfs /run tmpfs "-onosuid$RUNEXEC$RUN_OPT"
- [ -x /sbin/restorecon ] && /sbin/restorecon -r /run
+ [ -x "`command -v restorecon`" ] && restorecon -r /run
# Make pidfile omit directory for sendsigs
[ -d /run/sendsigs.omit.d ] || mkdir --mode=755 /run/sendsigs.omit.d/
@@ -540,7 +542,7 @@ mount_lock() {
# Make lock directory as the replacement for /var/lock
[ -d /run/lock ] || mkdir --mode=755 /run/lock
- [ -x /sbin/restorecon ] && /sbin/restorecon /run/lock
+ [ -x "`command -v restorecon`" ] && restorecon /run/lock
# Now check if there's an entry in /etc/fstab. If there is,
# it overrides the existing RAMLOCK setting.
@@ -595,7 +597,7 @@ mount_shm() {
rm -f "$SHMDIR"
fi
mkdir --mode=755 "$SHMDIR"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$SHMDIR"
+ [ -x "`command -v restorecon`" ] && restorecon "$SHMDIR"
fi
# Now check if there's an entry in /etc/fstab. If there is,
@@ -640,7 +642,7 @@ mount_tmp() {
if [ -L /tmp ] && [ ! -d /tmp ]; then
TMPPATH="$(readlink /tmp)"
mkdir -p --mode="${TMP_MODE}" "$TMPPATH"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$TMPPATH"
+ [ -x "`command -v restorecon`" ] && restorecon "$TMPPATH"
fi
# Disable RAMTMP if there's 64MiB RAM or less. May be
@@ -720,7 +722,7 @@ is_fastboot_active() {
# This function does not actually belong here; it is duct-tape solution
# for #901289.
logsave_best_effort() {
- if [ -x /sbin/logsave ]; then
+ if [ -x "`command -v logsave`" ]; then
logsave -s "${FSCK_LOGFILE}" "$@"
else
log_warning_msg "Cannot persist the following output on disc"
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/mountkernfs.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/mountkernfs.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/mountkernfs.sh
@@ -11,7 +11,7 @@
# provides and that are required by everything.
### END INIT INFO
-PATH=/sbin:/bin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/init/vars.sh
. /lib/init/tmpfs.sh
Index: sysvinit-3.15/debian/src/initscripts/etc/network/if-up.d/mountnfs
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/network/if-up.d/mountnfs
+++ sysvinit-3.15/debian/src/initscripts/etc/network/if-up.d/mountnfs
@@ -12,7 +12,8 @@ if [ -d /run/systemd/system ]; then
exit 0
fi
-PATH=/sbin:/bin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
. /lib/init/vars.sh
. /lib/lsb/init-functions
@@ -164,7 +165,7 @@ if [ no != "$ASYNCMOUNTNFS" ]; then
msg="if-up.d/mountnfs[$IFACE]: lock /run/network/mountnfs exists, not mounting"
log_failure_msg "$msg"
# Log if /usr/ is mounted
- [ -x /usr/bin/logger ] && /usr/bin/logger -t "if-up.d/mountnfs[$IFACE]" "$msg"
+ [ -x "`command -v logger`" ] && logger -t "if-up.d/mountnfs[$IFACE]" "$msg"
exit 0
fi
do_start
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/sendsigs
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/sendsigs
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/sendsigs
@@ -15,10 +15,10 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Make it possible to see who the misbehaving processes are
report_unkillable() {
- if [ -x /usr/bin/pstree ]; then
+ if [ -x "`command -v pstree`" ]; then
echo "Currently running processes (pstree):"
pstree
- elif [ -x /bin/ps ]; then
+ elif [ -x "`command -v ps`" ]; then
echo "Currently running processes (ps):"
ps -ef
fi
@@ -52,7 +52,7 @@ do_stop() {
# Upstart jobs have their own "stop on" clauses that sends
# SIGTERM/SIGKILL just like this, so if they're still running,
# they're supposed to be
- if [ -x /sbin/initctl ]; then
+ if [ -x "`command -v initctl`" ]; then
for pid in $(initctl list | sed -n -e "/process [0-9]/s/.*process //p"); do
OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
done
@@ -81,7 +81,7 @@ do_stop() {
# again on each loop and add any new jobs (e.g., plymouth) to
# the list. If we did miss one starting up, this beats waiting
# 10 seconds before shutting down.
- if [ -x /sbin/initctl ]; then
+ if [ -x "`command -v initctl`" ]; then
for pid in $(initctl list | sed -n -e "/process [0-9]/s/.*process //p"); do
OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
done
Index: sysvinit-3.15/debian/src/bootlogd/etc/init.d/stop-bootlogd
===================================================================
--- sysvinit-3.15.orig/debian/src/bootlogd/etc/init.d/stop-bootlogd
+++ sysvinit-3.15/debian/src/bootlogd/etc/init.d/stop-bootlogd
@@ -10,7 +10,7 @@
### END INIT INFO
NAME=stop-bootlogd
-DAEMON=/sbin/bootlogd
+DAEMON=`command -v bootlogd`
[ -x "$DAEMON" ] || exit 0
[ -d /run/systemd/system ] && exit 0
Index: sysvinit-3.15/debian/src/bootlogd/etc/init.d/stop-bootlogd-single
===================================================================
--- sysvinit-3.15.orig/debian/src/bootlogd/etc/init.d/stop-bootlogd-single
+++ sysvinit-3.15/debian/src/bootlogd/etc/init.d/stop-bootlogd-single
@@ -18,7 +18,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=stop-bootlogd-single
-DAEMON=/sbin/bootlogd
+DAEMON=`command -v bootlogd`
[ -x "$DAEMON" ] || exit 0
[ -d /run/systemd/system ] && exit 0
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/udev
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/udev
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/udev
@@ -43,16 +43,16 @@ mount_devtmpfs() {
}
create_dev_makedev() {
- if [ -e /sbin/MAKEDEV ]; then
- ln -sf /sbin/MAKEDEV /dev/MAKEDEV
+ if [ -e "`command -v MAKEDEV`" ]; then
+ ln -sf `command -v MAKEDEV` /dev/MAKEDEV
else
- ln -sf /bin/true /dev/MAKEDEV
+ ln -sf `which true` /dev/MAKEDEV
fi
}
# shell version of /usr/bin/tty
my_tty() {
- [ -x /bin/readlink ] || return 0
+ [ -x "`command -v readlink`" ] || return 0
[ -e /proc/self/fd/0 ] || return 0
readlink --silent /proc/self/fd/0 || true
}
@@ -77,9 +77,9 @@ warn_if_interactive() {
make_static_nodes() {
[ -e /lib/modules/$(uname -r)/modules.devname ] || return 0
- [ -x /bin/kmod ] || return 0
+ [ -x "`command -v kmod`" ] || return 0
- /bin/kmod static-nodes --format=tmpfiles --output=/proc/self/fd/1 |
+ kmod static-nodes --format=tmpfiles --output=/proc/self/fd/1 |
while read type name mode uid gid age arg; do
[ -e $name ] && continue
case "$type" in
@@ -88,8 +88,8 @@ make_static_nodes() {
*) echo "unparseable line ($type $name $mode $uid $gid $age $arg)" >&2 ;;
esac
- if [ -x /sbin/restorecon ]; then
- /sbin/restorecon $name
+ if [ -x "`command -v restorecon`" ]; then
+ restorecon $name
fi
done
}
@@ -167,7 +167,7 @@ case "$1" in
udevadm info --cleanup-db
# set the SELinux context for devices created in the initramfs
- [ -x /sbin/restorecon ] && /sbin/restorecon -R /dev
+ [ -x "`command -v restorecon`" ] && restorecon -R /dev
log_daemon_msg "Starting $DESC" "$NAME"
if start-stop-daemon --start --name $NAME --user root --quiet \
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/umountnfs.sh
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/umountnfs.sh
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/umountnfs.sh
@@ -79,7 +79,7 @@ do_stop() {
# emit unmounted-remote-filesystems hook point so any upstart jobs
# that support remote filesystems can be stopped
- if [ -x /sbin/initctl ]; then
+ if [ -x "`command -v initctl`" ]; then
initctl --quiet emit unmounted-remote-filesystems 2>/dev/null || true
fi
}
Index: sysvinit-3.15/debian/src/initscripts/etc/init.d/urandom
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/etc/init.d/urandom
+++ sysvinit-3.15/debian/src/initscripts/etc/init.d/urandom
@@ -22,7 +22,7 @@ SAVEDFILE=/var/lib/urandom/random-seed
[ -c /dev/urandom ] || exit 0
-PATH=/sbin:/bin
+PATH=/usr/sbin:/sbin:/usr/bin:/bin
if ! POOLBYTES=$(((\
$(cat /proc/sys/kernel/random/poolsize 2>/dev/null) + 7) / 8)); then
POOLBYTES=512
Index: sysvinit-3.15/debian/src/initscripts/usr/lib/udev/hwclock-set
===================================================================
--- sysvinit-3.15.orig/debian/src/initscripts/usr/lib/udev/hwclock-set
+++ sysvinit-3.15/debian/src/initscripts/usr/lib/udev/hwclock-set
@@ -2,11 +2,13 @@
# Reset the System Clock to UTC if the hardware clock from which it
# was copied by the kernel was in localtime.
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
dev=$1
if [ -e /run/systemd/system ]; then
exit 0
fi
-/sbin/hwclock --rtc=$dev --systz
-/sbin/hwclock --rtc=$dev --hctosys
+hwclock --rtc=$dev --systz
+hwclock --rtc=$dev --hctosys