Daemontools

All posts tagged Daemontools

Running openvpn under daemontools

Sunday, 21 March 2010 21:03
There are no translations available.

 

Prerequisite: Debian 5.0, openvpn

mkdir -p /var/service/
cd /var/service/
mkdir -m 1755 openvpn
cd openvpn
vim run

#!/bin/sh
exec 2>&1
exec /usr/sbin/openvpn –writepid /var/run/openvpn.server.pid \
–cd /etc/openvpn –config /etc/openvpn/server.conf –log /dev/stderr

chmod 755 run
mkdir -m 755 log
cd log
wget -O run http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run/etc/init.d/openvpn stop

ln -s /var/service/openvpn /service/openvpn
sleep 5

svstat /service/openvpn/ /service/openvpn/log/

Running backuppc under daemontools

Sunday, 21 March 2010 21:08
There are no translations available.

 

Prerequisite: Debian 5.0, backuppc

mkdir -p /var/service/
cd /var/service/
mkdir -m 1755 backuppc
cd backuppc
vim run

#!/bin/sh
exec 2>&1
echo “*** Starting backuppc…”
exec setuidgid backuppc /usr/share/backuppc/bin/BackupPC

chmod 755 run
mkdir -m 755 logcd log
wget -O run http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run
/etc/init.d/backuppc stop

ln -s /var/service/backuppc /service/backuppc
sleep 5

svstat /service/backuppc/ /service/backuppc/log/

Running hylafax under daemontools

Sunday, 04 April 2010 01:02
There are no translations available.

Prerequisite: Debian 5.0, Hylafax 4.4.4

Activating faxq through daemontools

mkdir -p /var/service/
cd /var/service/
mkdir -m 1755 faxq
cd faxq
vim run

#!/bin/shexec 2>&1
echo “Starting faxq…”
exec /usr/sbin/faxq -D
# that’s all, folks!

chmod 755 run
mkdir -p -m 755 log
cd logwget -O run http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run
ln -s /var/service/faxq /service/
sleep 5
svstat /service/faxq /service/faxq/log

 

Activating hfaxd through daemontools

mkdir -p /var/service/
cd /var/service/
mkdir -m 1755 hfaxd
cd hfaxd
vim run

#!/bin/sh
exec 2>&1
echo “Starting hfaxd…”
exec /usr/sbin/hfaxd -d -i 4559
# that’s all, folks!

chmod 755 run
mkdir -p -m 755 log
cd log
wget -O run http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run
ln -s /var/service/hfaxd /service/
sleep 5
svstat /service/hfaxd /service/hfaxd/log

 

Activating faxgetty through daemontools

mkdir -p /var/service/
cd /var/service/
mkdir -m 1755 faxgetty
cd faxgetty
vim run

#!/bin/sh
exec 2>&1
echo “Starting faxgetty…”
exec /usr/sbin/faxgetty ttyS0
# that’s all, folks!

chmod 755 run
mkdir -p -m 755 log
cd log
wget -O run http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run
ln -s /var/service/faxgetty /service/
sleep 5
svstat /service/faxgetty /service/faxgetty/log

Note

Remember to turn off the hylafax in xinetd

sysv-rc-conf

Running mysql in daemontools

Sunday, 21 March 2010 21:14
There are no translations available.

Prerequisite: Debian 5.0 Lenny, Mysql-server-5.0: 5.0.51a-24+lenny3

mkdir -m 1755 /var/service/mysqld
mkdir -p -m 755 /var/service/mysqld/log
cd /var/service/mysqld
vim run

#!/bin/sh
exec 2>&1
exec /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql \
–user=mysql –pid-file=/var/run/mysqld/mysqld.pid \
–skip-external-locking –port=3306 –socket=/var/run/mysqld/mysqld.sock

chmod 755 run
cd log
wget -O run
http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run

Stop the startup script:

/etc/init.d/mysql stop
sysv-rc-conf

The following commands will create the symbolic links needed to start the mysql service.ln -s /var/service/mysqld /service/
sleep 5
svstat /service/mysqld /service/mysqld/log

Running apache2 under daemontools

Sunday, 21 March 2010 20:58
Prerequisite: Debian 5.0, apache2

mkdir -m 1755 /var/service/apache2
mkdir -p -m 755 /var/service/apache2/log
cd /var/service/apache2

vim run

#!/bin/sh
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid
exec /usr/sbin/apache2 -DNO_DETACH

chmod 755 run
cd log
wget -O run
http://qmail.jms1.net/scripts/service-any-log-run
chmod 755 run

Stop the startup script:
/etc/init.d/apache2 stop
sysv-rc-conf

The following commands will create the symbolic links needed to start the service.

ln -s /var/service/apache2 /service/
sleep 5
svstat /service/apache2 /service/apache2/log