From 747d61a446c3e593e50aaf39b57291d1c6c23720 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 5 Nov 2023 19:00:09 +0000 Subject: [PATCH] Update rc.{local,shutdown} and modify shutdown procedure. --- etc/rc.local | 2 +- etc/rc.shutdown | 6 +++++- etc/runit/shutdown.d/00-rc-shutdown.sh | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 etc/runit/shutdown.d/00-rc-shutdown.sh diff --git a/etc/rc.local b/etc/rc.local index b660de8..ed1f09f 100755 --- a/etc/rc.local +++ b/etc/rc.local @@ -4,4 +4,4 @@ # This is run by runit in stage 2 before the services are executed # (see /etc/runit/2). -[[ -x /opt/bin/pushover-client ]] && /opt/bin/pushover-client -p -1 -m "Boot up: ${HOSTNAME%%.*}" +( sleep 10; [[ -x /opt/bin/pushover-client ]] && /opt/bin/pushover-client -p -1 -m "Boot up: ${HOSTNAME%%.*}" ) & diff --git a/etc/rc.shutdown b/etc/rc.shutdown index 34a327c..51e9383 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -4,4 +4,8 @@ # This is run by runit in stage 3 after the services are stopped # (see /etc/runit/3). -[[ -x /opt/bin/pushover-client ]] && /opt/bin/pushover-client -p -1 -m "Shutting down: ${HOSTNAME%%.*}" +[[ ! -e /run/rc-shutdown-ran ]] && { + [[ -x /opt/bin/pushover-client ]] && /opt/bin/pushover-client -p -1 -m "Shutting down: ${HOSTNAME%%.*}" + + toch /run/rc-shutdown-ran +} diff --git a/etc/runit/shutdown.d/00-rc-shutdown.sh b/etc/runit/shutdown.d/00-rc-shutdown.sh new file mode 100644 index 0000000..1df105b --- /dev/null +++ b/etc/runit/shutdown.d/00-rc-shutdown.sh @@ -0,0 +1 @@ +[ -x /etc/rc.shutdown ] && /etc/rc.shutdown