logging: Add logging command

Add new command and update startup scripts to use it

Signed-off-by: Nicholas Mello <nick@nmello.dev>
This commit is contained in:
2026-02-07 21:42:53 -06:00
parent 1bd2214dad
commit f58cc7aded
7 changed files with 54 additions and 8 deletions

View File

@@ -1,11 +1,11 @@
#!/bin/sh
start() {
modprobe gpio_keyboard_driver
}
LOG_DIR="/var/log/arcade/"
stop() {
rmmod gpio_keyboard_driver
start() {
echo "Setting up logging directory: ${LOG_DIR}"
mkdir -p "${LOG_DIR}"
chmod 1777 "${LOG_DIR}"
}
case "$1" in
@@ -13,10 +13,8 @@ case "$1" in
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)

View File

@@ -0,0 +1,30 @@
#!/bin/sh
start() {
log -n "startup-scripts" "Probing gpio_keyboard_driver"
modprobe gpio_keyboard_driver
log -n "startup-scripts" "Probed gpio_keyboard_driver with exit code $?"
}
stop() {
log -n "startup-scripts" "Removing gpio_keyboard_driver"
rmmod gpio_keyboard_driver
log -n "startup-scripts" "Removed gpio_keyboard_driver with exit code $?"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
log -l error -n "startup-scripts" "Must be start, stop, or restart"
exit 1
;;
esac