mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
fix: tune reboot timeout on panic, improve shutdown ulcmd support
* Ensure we have all the right targets for ulcmd-shutdown-hook to show the shutdown message * Move to an init script that we can use for setup commands, like adjusting our kernel panic timeout.
This commit is contained in:
parent
c259d223bf
commit
27713ab79e
4 changed files with 12 additions and 5 deletions
|
@ -1,10 +1,10 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Load UBNT kernel modules
|
Description=UBNT bootup init script
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/sbin/modprobe ubnthal
|
ExecStart=/usr/lib/init/boot/ubnt-init.sh
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
|
@ -1,11 +1,11 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ulcmd shutdown hook
|
Description=ulcmd shutdown hook
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Before=shutdown.target halt.target
|
Before=shutdown.target halt.target poweroff.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/ulcmd --sender system-hook --command poweroff
|
ExecStart=/usr/bin/ulcmd --sender system-hook --command poweroff
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=shutdown.target halt.target
|
WantedBy=shutdown.target halt.target poweroff.target
|
||||||
|
|
7
overlay/filesystem/usr/lib/init/boot/ubnt-init.sh
Executable file
7
overlay/filesystem/usr/lib/init/boot/ubnt-init.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Load our kernel modules
|
||||||
|
/usr/sbin/modprobe ubnthal
|
||||||
|
|
||||||
|
# Set our kernel panic timeout SUPER short so we reboot on crash
|
||||||
|
echo 2 > /proc/sys/kernel/panic
|
|
@ -16,7 +16,7 @@ apt-get update
|
||||||
apt-mark hold linux-image-* # We do not want these, as we run our own kernel!
|
apt-mark hold linux-image-* # We do not want these, as we run our own kernel!
|
||||||
|
|
||||||
# Setup our services
|
# Setup our services
|
||||||
systemctl enable load-ubnt-modules
|
systemctl enable ubnt-init
|
||||||
systemctl enable mock-ubnt-api
|
systemctl enable mock-ubnt-api
|
||||||
systemctl enable ulcmd
|
systemctl enable ulcmd
|
||||||
systemctl enable ulcmd-reboot-hook
|
systemctl enable ulcmd-reboot-hook
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue