diff --git a/lib/functions b/lib/functions index 8d018f7..f9538d2 100644 --- a/lib/functions +++ b/lib/functions @@ -690,13 +690,12 @@ _daemon_exec() { --exec "$prog" \ -- "$@" else - - if [ "$makepid" ] && [ "$pidfile" ]; then - export PIDFILE="$pidfile" - set -- /lib/rc-scripts/makepid "$@" - fi - if [ "$fork" = "1" ]; then + export PIDFILE="/dev/null" + if [ "$makepid" ] && [ "$pidfile" ]; then + export PIDFILE="$pidfile" + fi + set -- /lib/rc-scripts/makepid "$@" set -- /usr/bin/setsid "$@" fi if [ -n "$user" -a "$user" != "root" ]; then @@ -1009,7 +1008,7 @@ pidofproc() { fi # Next try "pidof" if pidfile is not specified - if [ -z "$pid" ] && [ -z "$pidfile" ]; then + if [ -z "$pid" ] && [ -z "$2" ]; then pid=$(pidof -o $$ -o $PPID -o %PPID -x "$1") fi commit bf42a4fb7c71c31954499bf9cbce4548305afe80 Author: Arkadiusz Miśkiewicz Date: Tue Jun 7 17:09:48 2016 +0200 Mount /run as mode=0755,noexec,nosuid,nodev. diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index f7f0eea..99bb078 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -409,7 +409,7 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then parse_cmdline if [ -d /run ]; then - is_fsmounted tmpfs /run || mount -n -t tmpfs run /run + is_fsmounted tmpfs /run || mount -n -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev fi # Early sysctls @@ -680,7 +680,7 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then mount -f -t devtmpfs devtmpfs /dev 2> /dev/null fi if is_fsmounted tmpfs /run; then - mount -f -t tmpfs run /run 2> /dev/null + mount -f -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev 2> /dev/null fi if is_fsmounted usbfs /proc/bus/usb; then commit 8903a3b15f08d759d06bb2b02e637e0baf7497bf Author: Arkadiusz Miśkiewicz Date: Tue Jul 3 15:13:45 2018 +0200 Don't fail if arrays are already assembled (ex raid10 with 4 devices, one device gets removed/kicked from array). diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 99bb078..6fdca19 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -326,8 +326,15 @@ init_mdadm() { fi show "Starting up RAID devices"; busy - /sbin/mdadm --assemble --scan --auto=yes + mdadm_out=$(/sbin/mdadm --assemble --scan --auto=yes 2>&1) rc=$? + + if (echo -n "$mdadm_out" | grep -q "Found some drive for an array that is already active:"); then + rc=0 + fi + + echo -n "$MDADM_OUT" >&2 + if [ "$rc" -eq 0 -o "$rc" -eq 2 ]; then # rc is used later too, so set sane value rc=0 commit 5d2ee544efe6d27d1b6bc263385c5c9b5bf1b00d Author: Arkadiusz Miśkiewicz Date: Thu Jan 18 10:41:54 2018 +0100 Onlink doesn't work for IPv6, so add gate route manually first. diff --git a/lib/functions.network b/lib/functions.network index bb7a525..d151b04 100644 --- a/lib/functions.network +++ b/lib/functions.network @@ -299,6 +299,7 @@ setup_ip_gw_ro () if [ -z "${IPV6_GLOBALROUTEDEV}" -o "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then # set up default route if [ "${IPV6_GLOBALROUTEGW}" ]; then + ip -6 route add ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink ip -6 route add 2000::/3 via ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink elif [ "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then ip -6 route add 2000::/3 dev ${DEVICE} ${IP6SRCADDR}