McCann, Brian bmccann
Thu May 26 13:45:28 PDT 2005
I do it as well...so perhaps I can tell you how my setup works at least.
Daemontools "supervise" process runs as root, then the child processes
(pgsql, slon, etc) run as whoever I tell them.  Here's my run script for
slon:

#!/bin/sh
exec 2>&1
echo "Starting slony"
exec envdir ./env sh -c '
        exec setuidgid pgsql /usr/local/bin/slon -s $SYNCINTERVAL
$CLUSTERNAME "dbname=$LOCALDBNAME user=$DBUSER host=localhost"
'

I've got several diff slon jobs (one per database).  This is one of
them, though they are all identical.  The envdir program loads
environment variables from the env directory inside that service, which
then provides all the variables you see.  The setuidgid is effectively a
sudo...so it runs slon as pgsql.  Check out http://cr.yp.to ....once you
understand DJB's documentation (it took me quite a while to realize how
simple it really is), and look at a few examples, like from tinydns,
it's all fairly straight forward.

Hope that helps,
--Brian

-----Original Message-----
From: slony1-general-bounces at gborg.postgresql.org
[mailto:slony1-general-bounces at gborg.postgresql.org] On Behalf Of Andrew
Hammond
Sent: Wednesday, May 25, 2005 17:03
To: Vivek Khera
Cc: slony1-general at gborg.postgresql.org
Subject: Re: [Slony1-general] start script(s) for Linux ...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vivek Khera wrote:
> 
> On May 25, 2005, at 10:49 AM, Marc G. Fournier wrote:
> 
>> check the 1.0.5 and find not init scripts for linux ... how are ppl 
>> doing it?  just adding the appropriate command to /etc/init.d/
>> postgresql, or is there another script ppl are using?
>
> I'm using daemontools to monitor and rotate logs for slon processes.  
> Works *really* well.

I'd like to see how you're doing that. Does it require root to do? I
seem to remember something deamontools related that required root.

- --
Andrew Hammond    416-673-4138    ahammond at ca.afilias.info
Database Administrator, Afilias Canada Corp.
CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFClOgUgfzn5SevSpoRAo6/AJ4hMkEh10MgUj0u+XzEUMv+orj65wCgiU99
u2sZK7y+7TcHiP6r5KgRsjw=
=jPu8
-----END PGP SIGNATURE-----
_______________________________________________
Slony1-general mailing list
Slony1-general at gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/slony1-general




More information about the Slony1-general mailing list