You are not logged in.
How does Archlinux shutdown?
Does it send a kill -HUP to all processes or does it use the /etc/rc.d/* files and tell them stop?
My problem is, that I have a mongrel_cluster running and it has to be shutdown via this script (otherwise some process.pids files wont get deleted preventing it from starting the next time).
Can I somehow configure this behavior or do I have to live with it that I have to manually delete the process.pids files after every reboot and start these server processes again?
Thanks for any ideas
Wabi
Offline
Every daemon is shut down through its script that is located in /etc/rc.d/, what's left then is asked to quit (sighup) and if that doesn't help killed (sigkill).
You could create a daemon script yourself, their setup is quite easy. An alternative would be to put what you need in /etc/rc.local.shutdown (if I have that right).
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
so if I understand this correctly an
# /etc/rc.d/mongrelcluster stop
is issued. because if I do this manually I can start the server again with /etc/rc.d/mongrelcluster start but after a reboot I have to go and manually delete some process.pids files.
If this is the same process how come does the result vary systematically?
Last edited by wabi (2010-08-10 10:22:08)
Offline
I'm not sure why there is variance, but I can confirm that "stop" is called on all the daemons, in reverse order as listed in rc.conf:
# Find daemons NOT in the DAEMONS array. Shut these down first
if [ -d /var/run/daemons ]; then
for daemon in $(/bin/ls -1t /var/run/daemons); do
if ! in_array $daemon ${DAEMONS[@]}; then
stop_daemon $daemon
fi
done
fi
# Shutdown daemons in reverse order
let i=${#DAEMONS[@]}-1
while [ $i -ge 0 ]; do
if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
fi
let i=i-1
done
stop_daemon() {
/etc/rc.d/$1 stop
}
Do you start it from the daemons array in /etc/rc.conf? Are there any logs you can look at?
Offline
Yes I do start the daemon from the DAEMONS array in /etc/rc.conf
Right now I don't have any logs but I'll grab them the next time I reboot.
Offline
I made a restart from in front of the computer today and noticed, that it would not shutdown the mongrel processes. I use mongrel_cluster_ctl and my /etc/rc.d/mongrelcluster is a symlink to /usr/bin/mongrel_cluster_ctl a script that anwsers to start|stop|restart.
Offline
I have a question -- (I am not in front of my machine, so I cannot read the script) -- It looks as if the calling of the stop method of the rc.d scripts depends upon there being an entry in /var/run/daemons.
Could there be an issue with that file?
Is that the PID that has to be deleted or are you deleting it from a different place?
Any chance that the name is different than the name in the daemons array?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Online
@ewaller, at first I thought that it only did that in the case that it is not in the daemons array, as that is all that code snippet shows. However, on furthur investigation it does the same check for daemons in the array as well.
ck_daemon() {
[ -f /var/run/daemons/$1 ] && return 1
return 0
}
@wabi, does said /usr/bin/mongrel_cluster_ctl create a file named mongrelcluster in /var/run/daemons? Did you do the symlinking, or is the package like that? If it didn't come like that and that is the problem, follow B's suggestion about rc.local.shutdown
Last edited by jac (2010-08-16 22:53:08)
Offline