You are not logged in.
Pages: 1
Here a piece of /etc/rc.shutdown:
if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Shutdown daemons
let i=${#DAEMONS[@]}
while [[ i -ge 0 ]]; do
if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then
/etc/rc.d/${DAEMONS[$i]#@} stop
fi
let i=i-1
done
# find any leftover daemons and shut them down
if [ -d /var/run/daemons ]; then
for daemon in `ls /var/run/daemons`; do
/etc/rc.d/$daemon stop
done
fi
fi
What does the first part `#Shutdown daemons' mean? Why the second is not enough?
I am asking since I think there is a bug somewhere. In my home computer I use ADSL daemon started in background to automatically connect to internet when I turn on the computer. If the connection fails when I turn off the system tries anyway to stop it.
On the other hand, using my laptop if I connect manually (still using /etc/rc.d/adsl) it won't disconnect on shutdown...
Thanks!
Offline
The first part means "shut down all the daemons that are listed in DAEMONS in rc.conf".
The second part means "shut down any daemons that have a PID file".
It sounds like neither the ADSL daemon nor its initscript creates a PID file.
Offline
The first part means "shut down all the daemons that are listed in DAEMONS in rc.conf".
More specifically, shut them down in the reverse order they were started.
Offline
So it is normal it tries to shutdown daemons that failed to start?
Offline
I guess so - I don't have an Arch box handy right now, so I can't verify 100%, but I think you're right. In general, though, the files in /etc/rc.d should guard against stopping a non-running service
Offline
What about changing it to something like:
if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Shutdown daemons
let i=${#DAEMONS[@]}
while [[ i -ge 0 ]]; do
if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 \
&& -a /var/run/${DAEMONS[$i]#@} ]]; then
/etc/rc.d/${DAEMONS[$i]#@} stop
fi
let i=i-1
done
[...]
fi
So it would stop only working services...
Yet this does not explain why when I connect manually with my laptop it does not disconnect automatically when I turn off or reboot...
Offline
Pages: 1