Search code examples
perlinit.dpsgi

Init scripts for Twiggy-based PSGI apps


I'm looking for a way to manage several Twiggy instances listening on different ports via a simple config file and a standard interface.

E.g. I want a config that looks like

dog 5000 /www/psgi/dog.pl
cow 5001 /www/psgi/holycow.pl
# ...

And a script in /etc/init.d that is used like

sudo service twiggy start
# start all services
sudo service twiggy restart dog
# cow remains intact
# ...

Some of my co-workers suggest runit, and it looks promising, however I'm not familiar enough with it yet.

Before starting to write my own script(s), I dare to ask SO: does one exist already?


Solution

  • Look at Daemon::Control for a way to manage your daemons and to automatically write init scripts