HowToRunLightyWithRunit » History » Revision 1
Revision 1/8
| Next »
Anonymous, 2006-12-22 11:06
= Lighty + Runit --> (almost) uninterruptible service :) =
I had some problem with lighty's stability in the past so I ended up using a simple supervisor written in shell.
I didn't need it much for a long time now, bu I thought runit would be a more elegant and robust solution than a shellscript + cron.
wajig install lighttpd
wajig install runit
}}}
This takes care of the basic config of both sw.
2. Creating the service directories and service scripts {{{
- mkdir -p /etc/sv/lighttpd/log/
- cat <<EOF >/etc/sv/lighttpd/run
#!/bin/bash
exec lighttpd -D -f /etc/lighttpd/lighttpd.conf 2>&1
EOF # - cat <<EOF >/etc/sv/lighttpd/log/run
#!/bin/bash
exec chpst -u nobody svlogd -tt /var/log/SV/
EOF # - chmod +x /etc/sv/lighttpd/run /etc/sv/lighttpd/log/run
1. Install the wanted components
}}}
{{{
- mkdir -p /var/log/SV
- chown nobody /var/log/SV
}}} {{{ - ln -s /etc/sv/lighttpd/ /var/service/
}}} {{{ - sv status lighttpd
run: lighttpd: (pid 4979) 19s; run: log: (pid 4606) 18s #
}}}
5. Checking status
'''Notes''': Logging will be ok for a single service this way but may be problematic if you have several processes logging to the same directory.
I haven't tried it so I wouldn't know :)
It would have been nice to make it log the problems of lighty's startup over syslog but I couldn't get it working.
The line below should have taken care of it but it didn't work as expected for me. YMMV.
{{{
echo "U127.0.0.1" > /var/log/SV/config
}}}
Updated by Anonymous almost 18 years ago · 1 revisions