Hi
I am on MX distro that does not use systemd but still on traditional init
I have read
https://www.behnke.io/fedora-17-on-a...t-on-shutdown/
and attempted to modify it for MX so it reads
Quote:
#! /bin/bash
### BEGIN INIT INFO
# Provides: haltusbpower
# Required-Start:
# Required-Stop:
# Default-Start: 0
# Default-Stop: 5 6
# Short-Description: Halt USB Powersave mode
# Description: A script to halt usb power control.
### END INIT INFO
# Bus list for the runtime power management module.
buslist="usb"
# See how we were called.
case "$1" in
start)
echo "USB bug fix active"
#no-op on startup
;;
stop)
echo "Turning off USB Power Control"
for bus in $buslist; do
for i in /sys/bus/$bus/devices/*/power/control; do
echo on > $i
done
done
;;
*)
echo "Usage: /etc/init.d/haltusbpower {start|stop}"
exit 1
;;
esac
exit 0
|
in various attempts of using either chkconfig or update-rc.d or insserv
I got various errors including the reason for the current start stop script stuff above
Code:
chkconfig --add haltusbpower
insserv: warning: current start runlevel(s) (0) of script `haltusbpower' overrides LSB defaults (S).
insserv: warning: current stop runlevel(s) (5 6) of script `haltusbpower' overrides LSB defaults (0 6).
haltusbpower 0:on 1:off 2:off 3:off 4:off 5:off 6:off
In particular I thought I should be using 0 for the default stop but when I did
I still do not get a sym link to rc0.d as a kill script
so far they are are all start scripts
Code:
ls -al /etc/rc0.d/ | grep usb
lrwxrwxrwx 1 root root 22 Jan 26 07:56 S01haltusbpower -> ../init.d/haltusbpower
in running as root powers sysv-rc-conf
I have a check against run level 0
if at haltusbpower I press the symbol to start or stop the service
I get the respective echo message....suggesting the start or stop service is working correctly.....manually
#####################################
what I don't have is the correct script to act on shut down as a kill script
any suggestions?
in some attempts insserv has shown sym links
/etc/init.d/.depend.start and its .stop both show haltusbpower
I was expecting to see it only in .depend.stop
thanks for reading