Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently running a few programmes - unreal, anope and the qwebirc web client on startup with crontab.

Anope dosen't take to a non graceful shutdown well, i use flat files for data as opposed to mysql and they corrupt often - i figure if i can get anope shutdown properly via the script it should solve it.

Approaches i suppose might work are using an init script, since crontab dosen't seem to have a @shutdown option, but i'd really like to do shut down apps at shutdown it at as the user i start at.

running ubuntu, but it should be the same on any box running linux

share|improve this question

1 Answer 1

If the daemon doesn't have an init script, you must create your own. Just use an existing script as a template. If you need to execute commands as the user who owns the process, use su or sudo in your init script.

rc0.d is the directory that is processed during a shutdown, be sure to place a symlink to your init script there.

Ubuntu has switched to upstart now, you might also want to take a look at that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.