On Jun 7, 2006, at 10:33 , John Peacock wrote:
The service directory should only contain
softlinks to the actual directory (in this case qpsmtpd). This
should be
clearer in the documentation for runit (which basically assumes you
already know
how to use daemontools/supervise apparently).
See these FAQ entries:
http://smarden.org/runit/faq.html#run
http://smarden.org/runit/faq.html#tell
(actually everything after the first link to the second will give
you a clue
about how is is supposed to work).
Thanks for the specific pointers to the faq. I've changed the setup
as you described (moving the run script to the qpsmtpd directory,
using ln -s to create a symlink from /var/service/qpsmtpd to /usr/
local/qpsmtpd). I tested the /usr/local/qpsmtpd/run script from the
command line and got the same successful results as when it was in /
var/service/qpsmtpd/. So that's good. Still doesn't work when run via
the service daemon.
Perhaps I'm reading the FAQ wrong (http://smarden.org/runit/
faq.html#create), but it appears to me that it's describing creating
the service directory and the run script in /etc/sv/ (which I
understand to correspond to /var/service/ in my configuration) rather
than symlinking to the installation directory. From my (admittedly
*extremely* limited) experience, it looks like either method should
work. Unfortunately neither does in my case yet.
Just to test to make sure the runit/launchd portions are working
correctly, I made a simple Perl script that just logs to syslog and
set it up to be run under runit (see below for details). That works
just fine. (Though it does look like unloading the runit
launchd.plist does not stop the runit service daemon -- the Perl
script continued to log even after the plist was unloaded. But that's
perhaps a question for another list.)
So, runit seems to work with launchd. The qpstmpd run script appears
to work with the qpstmpd-forkserver. What am I missing?
Michael Glaesemann
grzm seespotcode net
---
$ ls /usr/local/runit_test/
run runit_test supervise
$ cat /usr/local/runit_test/run
#!/bin/bash
/usr/local/runit_test/runit_test
$ cat /usr/local/runit_test/runit_test
#!/usr/bin/env perl
use warnings;
use strict;
use Sys::Syslog;
my $ident = 'runit_test';
my $logopts = 'pid';
my $facility = 'LOG_MAIL';
openlog $ident, $logopts, $facility;
my $loop;
while (1)
{
$loop++;
syslog('info', "this is loop $loop");
sleep 2;
}
closelog();
$ ls -l /var/service/
total 16
lrwxr-xr-x 1 root wheel 18 Jun 7 10:55 qpsmtpd -> /usr/local/
qpsmtpd
lrwxr-xr-x 1 root wheel 21 Jun 7 11:51 runit_test -> /usr/local/
runit_test