buildd-stop() { local need_sudo if [ -r ~buildd ] && [ -r ~buildd/build ] ; then need_sudo="" else need_sudo="sudo" fi if $need_sudo test -e ~buildd/NO-DAEMON-PLEASE; then echo "no-daemon-please already exists:" $need_sudo ls -l ~buildd/NO-DAEMON-PLEASE if $need_sudo test -e ~buildd/build/buildd.pid ; then echo "buildd still running?" else echo "pidfile of buildd doesn't exist. Good. Assuming it doesn't run." fi ps xauf | grep 'build[d]' else echo "Touching ~buildd/NO-DAEMON-PLEASE ~buildd/EXIT-DAEMON-PLEASE" sudo -u buildd touch ~buildd/NO-DAEMON-PLEASE ~buildd/EXIT-DAEMON-PLEASE && sudo chgrp -v adm ~buildd/NO-DAEMON-PLEASE && echo "Sending HUP to buildd" sudo -u buildd kill -HUP `sudo cat ~buildd/build/buildd.pid` fi }