From e47ef966d66f53b89f339413d6e17be9f0d670bd Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Mon, 21 Aug 2023 19:16:25 -0700 Subject: [PATCH] overlay: add rc.local capability Improved Startup with rc.local Scripts. Added S99rc.local to /etc/init.d/ and created /etc/rc.local. This lets users easily run their own commands at the end of startup. It's a straightforward way to customize and optimize the system's start-up process. --- general/overlay/etc/init.d/S99rc.local | 32 ++++++++++++++++++++++++++ general/overlay/etc/rc.local | 14 +++++++++++ 2 files changed, 46 insertions(+) create mode 100755 general/overlay/etc/init.d/S99rc.local create mode 100755 general/overlay/etc/rc.local diff --git a/general/overlay/etc/init.d/S99rc.local b/general/overlay/etc/init.d/S99rc.local new file mode 100755 index 00000000..84a48f86 --- /dev/null +++ b/general/overlay/etc/init.d/S99rc.local @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Start rc.local +# + + +start() { + printf "Starting rc.local" + /etc/rc.local +} + +restart() { + printf "Restarting rc.local" + /etc/rc.local +} + +case "$1" in + start) + "$1" + ;; + + restart|reload) + start + ;; + + *) + echo "Usage: $0 {start|restart|reload}" + exit 1 + ;; +esac + +exit $? diff --git a/general/overlay/etc/rc.local b/general/overlay/etc/rc.local new file mode 100755 index 00000000..65634dfa --- /dev/null +++ b/general/overlay/etc/rc.local @@ -0,0 +1,14 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +exit 0