Vivek Khera vivek
Tue Jul 26 19:16:44 PDT 2005
Here's an interactive script I include in the FreeBSD port to create  
the daemontools environment to run and log slon daemons.  Feel free  
to include it in the contrib tree.

Basically it expects all the real slony related configs to be in a  
file /usr/local/etc/slon.conf

Vivek Khera, Ph.D.
+1-301-869-4449 x806


--cut here--
#!/bin/sh

# create a slon service directory for use with svscan from deamontools

echo -n 'specify directory for "slon" service like "/var/slon-master": '
read DIR
if [ -z "$DIR" ]; then
echo "Directory must be non-empty"
exit 1;
fi

echo -n 'System user name for programs to run under (default pgsql): '
read sysuser
if [ -z "$sysuser" ]; then
echo "User name pgsql being used."
sysuser='pgsql'
fi

mkdir -p ${DIR}/env ${DIR}/supervise || exit 1
mkdir -p ${DIR}/log/main ${DIR}/log/supervise || exit 1

cat > ${DIR}/run  <<EOF
#!/bin/sh
exec 2>&1

exec envdir ./env sh -c 'exec envuidgid ${sysuser} slon -f \$ 
{CONFIGFILE}'
EOF
chmod +x ${DIR}/run

cat >${DIR}/log/run <<EOF
#!/bin/sh
exec setuidgid ${sysuser} multilog t ./main
EOF
chmod +x ${DIR}/log/run

echo "/usr/local/etc/slon.conf" > ${DIR}/env/CONFIGFILE

chown -R ${sysuser} ${DIR}
--cut here--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2476 bytes
Desc: not available
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050726/cf1ef797/smime.bin


More information about the Slony1-general mailing list