diff --git a/init.d/hwdetect b/init.d/hwdetect new file mode 100755 index 0000000..f230b70 --- /dev/null +++ b/init.d/hwdetect @@ -0,0 +1,18 @@ +#!/usr/bin/env watchman + +service_type='oneshot' + +start() { + watchman.msg "Running module autodetect..." + watchman.start +} + +spawn() { + # The Alpine Linux hwdetect script runs this twice. + # Apparently to make sure we get devices that appear after loading a module on the first run. + find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null + find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null + + # This script cannot be regarded as failed. It has no definitive failure state. + return 0 +} diff --git a/init.d/lo.iface b/init.d/lo.iface index 7f3f3ad..2ad1484 100755 --- a/init.d/lo.iface +++ b/init.d/lo.iface @@ -14,8 +14,9 @@ wait_for_iface() { done } -spawn() { +start() { watchman.msg "Activating the $cfg_iface interface..." + watchman.start wait_for_iface || { echo "Interface $cfg_iface failed to come up!" @@ -24,13 +25,7 @@ spawn() { } stop() { - watchman.status || { - watchman.err "$service_name is already disabled" - return 1 - } - watchman.msg "Deactivating the $cfg_iface interface..." - ip link set "${cfg_iface}" down watchman.stop }