2 Sep 2003 14:12
Re: Runit scripts and mysql
Erich Schubert <erich <at> debian.org>
2003-09-02 12:12:29 GMT
2003-09-02 12:12:29 GMT
Hi, > Yes. I don't use mysql, but from what I've read, it doesn't terminate > when receiving a TERM signal on Linux. If mysql would do that, there > would be no problem. Attached is a script i hacked together which works for me. It's kind of debian-specific, because it relies on the distribution admin uesr with shutdown rights in mysql. Users of other distributions will need to modify the MYSQLADMIN line. ----- mysql/run ----- #!/bin/sh cd / umask 077 MYSQLADMIN='/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf' trap "$MYSQLADMIN shutdown" 0 trap 'exit 2' 1 2 3 15 /usr/bin/mysqld_safe & wait ----- I tried without the "& wait", but it didn't recieve the signals then. It's an ugly hack, but it works. (tm) > http://article.gmane.org/gmane.comp.djb.syslog/742 This one seems similar to my "solution". But i will open a bug report against mysql-server today -- it really should support shutdown via -TERM... Here is also a modified script for rpc.mountd: the difference to the one from the collection on the web page is that this script will kill all nfsd when stopped, not only mountd. ("killall -2 nfsd" seems to be the proper way to shutdown these - the debian standard script uses start-stop-daemon "--signal 2") ---- mountd/run ---- #!/bin/sh svwaitup /var/service/statd RPCNFSDCOUNT=8 # Number of servers to be started up by default RPCMOUNTDOPTS= trap '/usr/bin/killall -2 nfsd' 0 trap 'exit 2' 1 2 3 15 /usr/sbin/exportfs -r /usr/sbin/rpc.nfsd -- $RPCNFSDCOUNT /usr/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 || RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3" /usr/sbin/rpc.mountd -F $RPCMOUNTDOPTS ---- Greetings, Erich Schubert -- -- erich <at> (vitavonni.de|debian.org) -- GPG Key ID: 4B3A135C (o_ The best things in life are free: Friendship and Love. //\ In unseren Freunden suchen wir, was uns fehlt. --- Thornton Wilder V_/_
RSS Feed