Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Restart lighttpd script (See related posts)

I use this script to avoid having to do the killall dance on my local dev box constantly when tweaking my lighttpd.conf

#!/bin/sh
sudo killall -9 lighttpd
sudo killall -9 ruby
sudo /opt/local/sbin/lighttpd -f /opt/local/etc/lighttpd.conf


Make the script executable (chmod u+x), put it in your path, invoke by simply typing the name of the script. This also kills off any ruby processes, which lighttpd will restart when it reboots.

The path to lighttpd and the lighttpd.conf files are based on the installation from DarwinPorts - adjust as needed.

Comments on this post

jimray posts on Sep 14, 2005 at 08:57
If you're using launchd to start lighttpd automatically in OS X, you don't need the last line that explicitly calls lighttpd - launchd will do that for you! Just killing the process will cause it to reboot.
johnl posts on Sep 19, 2005 at 14:42
Only use this script if you don't care that any Ruby process is terminated!

This would include scrips you might be running currently, IRC bots, and the like.

Better would be to find the instances of ruby that are running public/dispatch.fcgi, and only kill those.
richstyles posts on Apr 11, 2006 at 04:26
You can also shorten it to one line so an alias is just as good:

sudo killall -9 lighttpd ruby

You need to create an account or log in to post comments to this site.


Related Posts