1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>runit - collection of run scripts</title>
</head>
<body>
<a href="http://smarden.org/pape/">G. Pape</a><br>
<a href="index.html">runit</a><br>
<a href="replaceinit.html">How to replace init</a>
<hr>
<h1>runit - collection of run scripts</h1>
<hr>
This is a collection of <tt>run</tt> scripts for popular services to have
them monitored by the
<a href="http://cr.yp.to/daemontools.html">daemontools</a> or
<a href="http://smarden.org/runit/">runit</a> package.
If you have additional run scripts or one of these run scripts works for you on
an operating system not stated here, please
<a href="mailto:pape-runscripts@smarden.org">let me know</a>.
<p>
Thanks go to the following people for contributing run scripts:
Alessandro Bono, Robin S. Socha, Claus Alboege, Paul Jarc, clemens fischer,
Jesse Cablek, Lukas Beeler, Thomas Baden, Ralf Hildebrandt, Antonio Dias,
Erich Schubert, Lang Martin, Tomasz Nidecki, Marek Bartnikowski,
Thomas Schwinge, Gael Canal, Woon Wai Keen, Richard A Downing, Phil Genera,
Stefan Karrmann, Kevin Berry, Karl Chen.
<hr>
<a href="#atftpd">atftpd</a><br>
<a href="#apache">apache</a><br>
<a href="#apache2">apache2</a><br>
<a href="#atd">atd</a><br>
<a href="#bind9">bind9</a><br>
<a href="#boa">boa</a><br>
<a href="#cfengine">cfengine</a><br>
<a href="#cfsd">cfsd</a><br>
<a href="#chrony">chrony</a><br>
<a href="#clamav">clamav</a><br>
<a href="#courier-imap">courier-imap</a><br>
<a href="#cron">cron</a><br>
<a href="#cups">cups</a><br>
<a href="#dhclient">dhclient</a><br>
<a href="#dhcpcd">dhcpcd</a><br>
<a href="#dhcpd">dhcpd</a><br>
<a href="#dictd">dictd</a><br>
<a href="#dropbear">dropbear</a><br>
<a href="#exim">exim</a><br>
<a href="#expireproctitle">expireproctitle</a><br>
<a href="#fam">fam</a><br>
<a href="#fcron">fcron</a><br>
<a href="#gdm">gdm</a><br>
<a href="#getty">getty</a><br>
<a href="#gpm">gpm</a><br>
<a href="#hotwayd">hotwayd</a><br>
<a href="#identd">identd</a><br>
<a href="#inn">inn</a><br>
<a href="#jabberd">jabberd</a><br>
<a href="#junkbuster">junkbuster</a><br>
<a href="#kdm">kdm</a><br>
<a href="#keepalived">keepalived</a><br>
<a href="#klogd">klogd</a><br>
<a href="#leafnode">leafnode</a><br>
<a href="#loglinuxkernel">logging Linux kernel messages</a><br>
<a href="http://multivac.cwru.edu./fdtools/grabconsole/">
logging console messages</a><br>
<a href="#mdadm">mdadm</a><br>
<a href="#minidentd">minidentd</a><br>
<a href="#mpd">mpd</a><br>
<a href="#nscd">nscd</a><br>
<a href="#ntpd">ntpd</a><br>
<a href="#nullidentd">nullidentd</a><br>
<a href="#polipo">polipo</a><br>
<a href="#pop3-ssl">pop3-ssl</a><br>
<a href="#pop3vscan">pop3vscan</a><br>
<a href="#portmap">portmap</a><br>
<a href="#postgresql">postgresql</a><br>
<a href="#ppp">ppp</a><br>
<a href="#privoxy">privoxy</a><br>
<a href="#proftpd">proftpd</a><br>
<a href="#pure-ftpd">pure-ftpd</a><br>
<a href="#radiusd">radiusd</a><br>
<a href="#rsyncd">rsyncd</a><br>
<a href="#samba">samba (smbd, nmbd)</a><br>
<a href="#shoutcast">shoutcast</a><br>
<a href="#spamd">spamd</a><br>
<a href="#squid">squid</a><br>
<a href="#sshd">sshd</a><br>
<a href="#sshdtcpserver">sshd under tcpserver</a><br>
<a href="#statd">statd</a>, <a href="#mountd">mountd</a><br>
<a href="#stunnel">stunnel</a><br>
<a href="#swat">swat</a><br>
<a href="#syslogd">syslogd</a><br>
<a href="#taiclockd">taiclockd</a><br>
<a href="#tmda-ofmipd">tmda-ofmipd</a><br>
<a href="#tomcat">tomcat</a><br>
<a href="#tor">tor</a><br>
<a href="#vsftpd">vsftpd</a><br>
<a href="#wvdial">wvdial</a><br>
<a href="#xdm">xdm</a><br>
<a href="#xfs">xfs</a><br>
<hr>
<h3><a name="atftpd">An <tt>atftpd</tt> run script</a></h3>
(<i>Debian</i>)
<pre>
#!/bin/sh
exec /usr/sbin/in.tftpd --daemon --no-fork --tftpd-timeout 30 \
--retry-timeout 5 --no-tsize --no-blksize --no-multicast \
--maxthread 1000 --verbose=7 /var/atfpd 2>&1
</pre>
<hr>
<h3><a name="apache">An <tt>apache</tt> run script</a></h3>
(<i>SunOS</i>, Apache 1.*, patched to run under supervise)
<pre>
#!/bin/sh
exec 2>&1
exec env -i \
/pack/apache/1.3.27-1/sbin/httpd -F 2>&1
</pre>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec 1>&2
exec apache-ssl -F
</pre>
<hr>
<h3><a name="apache2">An <tt>apache2</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
exec 2>&1
exec env -i /command/pgrphack \
/pack/apache/2.0.43-1/sbin/httpd -DFOREGROUND 2>&1
</pre>
(<i>HP-UX/GNU</i>, <i>Linux</i>)
<pre>
#!/bin/sh
TZ=MET-1METDST
export TZ
exec /usr/local/apache2/bin/httpd -DNO_DETACH
</pre>
<hr>
<h3><a name="atd">An <tt>atd</aa> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec atd -d
</pre>
<hr>
<h3><a name="bind9">A <tt>bind9</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
MEM="`head -1 ./env/MEM`"
CHROOT="`head -1 ./env/CHROOT`"
exec softlimit -m "${MEM}" \
named -u bind -t "${CHROOT}" -g 2>&1
</pre>
(<i>HP-UX/GNU</i>, <i>Linux</i>)
<pre>
#!/bin/sh
exec /usr/sbin/named -f -t /var/spool/named/ -u named
</pre>
<hr>
<h3><a name="boa">A <tt>boa</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
exec 2>&1
ulimit -n 1024
exec /pack/boa/current/boa -c /pack/boa/current -d 2>&1
</pre>
<hr>
<h3><a name="cfengine">A <tt>cfengine</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
/pack/cfengine/sbin/cfagent --file /pack/cfengine/etc/cfagent.conf \
-L -v -q exec sleep 3600
</pre>
<hr>
<h3><a name="cfsd">A <tt>cfsd</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=cfsd
CONFIG_FILE=/etc/cfs.conf
# source config file
test ! -r "$CONFIG_FILE" || . "$CONFIG_FILE"
test -n "$CRYPT_ROOT" || exit 0
test -n "$NULL_EXPORT" || exit 0
test -n "$CFS_MOUNT" || exit 0
test -n "$CFS_UMOUNT" || exit 0
svwaitup -s 2 /var/service/portmap
exec env \
NODAEMON=1 CFS_MOUNT="$CFS_MOUNT" CFS_UMOUNT="$CFS_UMOUNT" $DAEMON
</pre>
<hr>
<h3><a name="chrony">A <tt>chrony</tt> run script</a></h3>
(<i>LFS</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/sbin/chronyd -d -r -s
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="clamav">A <tt>clamd</tt> run script</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/local/bin/setuidgid clamav \
/usr/local/bin/softlimit -a 40000000 /usr/local/sbin/clamd
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="courier-imap">A <tt>courier-imap</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
exec 2>&1
PREFIX="/usr/lib/courier-imap"
exec envdir ./env \
tcpserver -v -R 0 143 \
$PREFIX/sbin/imaplogin \
$PREFIX/libexec/authlib/authshadow \
$PREFIX/libexec/authlib/authvchkpw \
$PREFIX/bin/imapd Maildir
</pre>
See also <a href="http://jonaspasche.de/courier-imap-daemontools.txt">
this page</a>.
<hr>
<h3><a name="cron">A <tt>cron</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec cron -f -l
</pre>
<hr>
<h3><a name="cups">A <tt>cups</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/sbin/cupsd -f
</pre>
<hr>
<h3><a name="dhclient">A <tt>dhclient</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec dhclient -e -d -cf ./config -lf ./leases -pf ./pid eth1
</pre>
<hr>
<h3><a name="dhcpcd">A <tt>dhcpcd</tt> run script</a></h3>
(<i>Linux</i>, DHCP Client Daemon v.scriptconfig-0.1)
<pre>
#!/bin/sh
dhcpcd -a -d -D -H eth0
</pre>
<hr>
<h3><a name="dhcpd">A <tt>dhcpd</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec 2>&1
exec dhcpd-2.2.x -f -d -cf ./config eth0
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<p>
(<i>Solaris 8</i>, uses additional dsvclockd service, would get fired off
automatically, but then it's not supervised)
<pre>
#!/bin/sh
exec 2>&1
exec /command/envdir ./env /usr/lib/inet/dsvclockd -f
</pre>
<pre>
#!/bin/sh
if /command/svok /service/dsvclockd; then
/usr/bin/sleep 2 # wait to make sure dsvclockd is initialized
exec 2>&1
exec /command/envdir ./env /usr/lib/inet/in.dhcpd -b manual -d # -v
fi
echo dsvclockd is not running - aborting
exec /usr/bin/sleep 5
</pre>
The in.dhcpd service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="dictd">A <tt>dictd</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec dictd -d nodetach
</pre>
<hr>
<h3><a name="dropbear">A <tt>dropbear</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec dropbear -F -E -p 22
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<p>
(<i>Linux</i>, running under
<a href="http://smarden.org/ipsvd/tcpsvd.8.html">tcpsvd</a>)
<pre>
#!/bin/sh
exec 2>&1
exec tcpsvd -v -i./peers 0 22 dropbear -i -E
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="exim">An <tt>exim</tt> run script</a></h3>
(<i>Linux</i>, <i>FreeBSD</i>)
<pre>
#!/bin/sh
exec /usr/local/sbin/exim -bdf -q30m
</pre>
<hr>
<h3><a name="expireproctitle">
<tt>expireproctitle</tt> run script examples</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
echo -n .
exec sleep 300
</pre>
<hr>
<h3><a name="fam">A <tt>fam</tt> run script</a></h3>
(<i>Slackware Linux 9.0</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/bin/fam -L -f -v
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<p>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
svwaitup -s 2 /var/service/portmap
exec famd -T 0 -f
</pre>
<hr>
<h3><a name="fcron">A <tt>fcron</tt> run script</a></h3>
(<i>LFS</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/sbin/fcron -f -y
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="gdm">A <tt>gdm</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec gdm -nodaemon
</pre>
<hr>
<h3><a name="getty">A <tt>mingetty</tt> run script</a></h3>
(<i>Debian</i>)
<pre>
#!/bin/sh
exec mingetty tty5
</pre>
The <a href="index.html">runit</a> package does not care about utmp records
for getties. You should choose a getty that handles its own utmp and wtmp
records.
Debian's <tt>mingetty</tt> creates its own utmp record.
<h3>An <tt>agetty</tt> run script</h3>
(<i>Slackware Linux 9.0</i>)
<pre>
#!/bin/sh
exec /sbin/agetty 38400 tty1 linux
</pre>
<h3>A <tt>fgetty</tt> run script</h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec chpst -P fgetty tty4
</pre>
The <a href="runsv.8.html">runsv</a> program does not automatically create
a new session and separate process group for run scripts, which can
cause some <i>getties</i> to fail due to limited permissions.
The <a href="chpst.8.html">chpst</a> program can be used to alter the
process state for those <i>getties</i>.
<hr>
<h3><a name="gpm">A <tt>gpm</tt> run script</a></h3>
(<i>LFS</i>)
<pre>
#!/bin/sh
exec 2>&1
. /etc/sysconfig/mouse
exec gpm -D -m $MDEVICE -t $PROTOCOL
</pre>
<hr>
<h3><a name="hotwayd">A <tt>hotwayd</tt> run script</a></h3>
(<i>LFS</i>)
<pre>
#!/bin/sh
exec 2>,&1
exec tcpsvd -l0 -u nobody 127.0.0.1 110 /usr/sbin/hotwayd
</pre>
<hr>
<h3><a name="identd">An <tt>oidentd</tt> run script</a></h3>
(<i>Linux</i>, oidentd version 2.0.6)
<pre>
#!/bin/sh
exec 2>&1
exec oidentd -i -S -t 10 -u daemon -g daemon
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<p>
(<i>Debian</i>)
<pre>
#!/bin/sh
exec /usr/local/sbin/oidentd --nosyslog -i -u ident -g ident -l 15 -m \
-C /etc/oidentd/oidentd.conf 2>&1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="inn">An <tt>innd</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
MEM="`head -1 ./env/MEM`"
exec softlimit -m "${MEM}" \
setuidgid news \
/usr/sw/bin/news/inndstart -f -r
</pre>
<hr>
<h3><a name="jabberd"><tt>jabberd</tt> run scripts</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec 2>&1
if [ -f /usr/local/jabber/jabber.pid ]; then
rm /usr/local/jabber/jabber.pid
fi
exec /usr/local/bin/setuidgid jabberd \
/usr/local/jabber/jabberd/jabberd -D -c /etc/jabber.xml
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<pre>
#!/bin/sh
exec 2>&1
sleep 5 # so that jit starts after jabberd is up
exec /usr/local/bin/setuidgid jabberd \
/usr/local/jabber/jit/jabberd/jabberd -c /etc/jit.xml
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="junkbuster">A <tt>junkbuster</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
DAEMON=junkbuster
exec "$DAEMON" /etc/junkbuster/config
</pre>
<hr>
<h3><a name="kdm">A <tt>kdm</tt> run script</a></h3>
(<i>Debian sid</i>, <i>FreeBSD 5.3-REL</i>)
<pre>
#!/bin/sh
svwaitup -s 2 /service/getty-*
exec kdm -nodaemon
</pre>
<hr>
<h3><a name="keepalived">A <tt>keepalived</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec keepalived -n
</pre>
<hr>
<h3><a name="klogd">A <tt>klogd</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec /sbin/klogd -n
</pre>
<hr>
<h3><a name="leafnode">A <tt>leafnode</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec envuidgid news \
tcpserver -v -x rules.cdb -c 10 -U 0 119 \
leafnode
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="loglinuxkernel">
A run script for <tt>logging Linux kernel messages with multilog</tt></a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh -e
exec < /proc/kmsg \
setuidgid loguser \
multilog t n64 ./main
</pre>
<hr>
<h3><a name="mdadm">A <tt>mdadm</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
DEBIANCONFIG=/etc/default/mdadm
MAIL_TO=root
test -f $DEBIANCONFIG && . $DEBIANCONFIG
exec mdadm --monitor --scan --mail $MAIL_TO
</pre>
<hr>
<h3><a name="minidentd">A <tt>minidentd</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec envuidgid nobody \
tcpserver -vUR 0 113 \
timeoutafter 60 \
minidentd -v
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="mpd">A <tt>mpd</tt> run script</a></h3>
(<i>Debian sid</i>, <i>FreeBSD 5.3-REL</i>)
<pre>
#!/bin/sh
MPDCONF=/etc/mpd.conf
exec mpd --stdout --no-daemon $MPDCONF
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="nscd">A <tt>nscd</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
secure=""
for table in passwd group
do
if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
then
nscd_nischeck $table || secure="$secure -S $table,yes"
fi
done
exec nscd -d -- $secure
</pre>
<hr>
<h3><a name="ntpd">A <tt>ntpd</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
MEM=`head -1 ./env/MEM`
exec softlimit -m "${MEM}" \
ntpd -n
</pre>
<hr>
<h3><a name="nullidentd">A <tt>nullidentd</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec tcpsvd -u nobody -x nullidentd-cdb -t 60 0 113 nullidentd
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="polipo">A <tt>polipo</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec setuidgid polipo \
polipo -c config forbiddenFile="`pwd`"/forbidden diskCacheRoot="`pwd`"/cache
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="pop3-ssl">A <tt>pop3-ssl</tt> run script</a></h3>
(<i>BSD</i>)
<pre>
#!/bin/sh
exec /usr/local/bin/tcpserver -R -v -c 50 0 995 /usr/local/sbin/stunnel
-f -p /etc/ssl/stunnel.pem \
-l /var/qmail/bin/qmail-popup -- /var/qmail/bin/qmail-popup
"`cat /var/qmail/control/me`" vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="pop3vscan">A <tt>pop3vscan</tt> run script</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/local/bin/setuidgid pop3vscan /usr/sbin/pop3vscan -d
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="portmap">A <tt>portmap</tt> run script</a></h3>
(<i>LFS</i>, <i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec portmap -d
</pre>
<hr>
<h3><a name="postgresql">A <tt>postgresql</tt> run script</a></h3>
(<i>Debian</i>, <i>SunOS</i>)
<pre>
#!/bin/sh
exec setuidgid postgres /usr/lib/postgresql/bin/postmaster \
-D /var/lib/postgres/data 2>&1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="ppp">A <tt>ppp</tt> run script</a></h3>
(<i>FreeBSD</i>)
<pre>
#!/bin/sh
exec 2>&1
echo "ppp -ddial dsl "
exec /usr/sbin/ppp -unit0 -foreground dsl
</pre>
<h3>A <tt>pppd</tt> run script</h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
exec 2>&1
exec chpst -P pppd call isp nodetach
</pre>
<hr>
<h3><a name="privoxy">A <tt>privoxy</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec chpst -u privoxy:nogroup privoxy --no-daemon /etc/privoxy/config
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="proftpd">A <tt>proftpd</tt> run script</a></h3>
(<i>Linux</i>, ProFTPD Version 1.2.8rc1,
configure it to use 'ErrorLog "/dev/stdout"')
<pre>
#!/bin/sh
exec 2>&1
exec proftpd -n -d 1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="pure-ftpd">A <tt>pure-ftpd</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/sbin/pure-ftpd -a 50 -E -l pam -u 100
</pre>
<hr>
<h3><a name="radiusd">A <tt>radiusd</tt> run script</a></h3>
(<i>Slackware Linux 9.0</i>, cistron radius 1.6.1)
<pre>
#!/bin/sh
exec 2>&1
exec radiusd -f -y -z -lstdout
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="rsyncd">A <tt>rsyncd</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
exec 2>&1
exec softlimit -d 100000000 /usr/local/bin/tcpserver \
-x /pack/rsync/rsync.service/tcp.rsync.cdb -v -c 100 -U -H -l 0 -R \
1.2.3.4 873 nice -2 /pack/rsync/bin/rsync --daemon --no-detach \
--config /pack/rsync/etc/rsyncd.conf
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="samba">A <tt>smbd</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
PATH="/usr/local/samba/bin"
exec 2>&1
exec smbd -F -S -d3
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<h3>A <tt>nmbd</tt> run script</h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
PATH="/usr/local/samba/bin"
exec 2>&1
exec nmbd -F -S -d1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="shoutcast">A <tt>shoutcast</tt> run script</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/local/bin/setuidgid sc_serv \
/usr/local/sc_serv/bin/sc_serv /etc/sc_serv.conf
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="spamd">A <tt>spamd</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec /usr/sbin/spamd -m 20 -a -H -s stderr 2>&1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="squid">A <tt>squid</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec squid -f ./config -sN
</pre>
<hr>
<h3><a name="sshd">A <tt>sshd</tt> run script</a></h3>
(<i>Debian woody</i>, sshd version OpenSSH_2.9p2)
<pre>
#!/bin/sh
exec 2>&1
exec sshd -D -e
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="sshdtcpserver">
A <tt>sshd (under tcpserver)</tt> run script</a></h3>
(<i>Linux</i>, sshd version OpenSSH_3.4p1)
<pre>
#!/bin/sh -e
exec 2>&1
exec \
tcpserver -1vpdl0 -Xxtcp.cdb 0 ssh \
sshd -ief config
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="statd">A <tt>statd</tt> run script</a></h3>
(<i>Debian woody</i>)
<pre>
#!/bin/sh
exec 2>&1
NEED_LOCKD=yes
if test -f /proc/ksyms; then
# We need to be conservative and run lockd,
# unless we can prove that it isn't required.
grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
fi
if [ "$NEED_LOCKD" = yes ]; then
/sbin/rpc.lockd
fi
exec rpc.statd -F -d
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<h3><a name="mountd">A <tt>mountd</tt> run script</a></h3>
(<i>Debian</i>)
<pre>
#!/bin/sh
svwaitup /var/service/statd
RPCNFSDCOUNT=8 # Number of servers to be started up by default
RPCMOUNTDOPTS=
trap '/usr/bin/killall -2 nfsd' 0
trap 'exit 2' 1 2 3 15
/usr/sbin/exportfs -r
/usr/sbin/rpc.nfsd -- $RPCNFSDCOUNT
/usr/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"
/usr/sbin/rpc.mountd -F $RPCMOUNTDOPTS
</pre>
<hr>
<h3><a name="stunnel">A <tt>stunnel</tt> run script</a></h3>
(<i>BSD</i>)
<pre>
#!/bin/sh
exec /usr/local/sbin/stunnel -f -d 1234 -r 25 -v3 -a /etc/ssl/mailcerts 2>&1
</pre>
<hr>
<h3><a name="swat">A <tt>swat</tt> run script</a></h3>
<pre>
#!/bin/sh
exec 2>&1
exec tcpsvd -l0 127.0.0.1 901 /usr/sbin/swat
</pre>
<hr>
<h3><a name="syslogd">A <tt>syslogd</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec syslogd -n
</pre>
<hr>
<h3><a name="taiclockd">A <tt>taiclockd</tt> run script</a></h3>
<pre>
#!/bin/sh
exec 2>&1
exec setuidgid taiclock /usr/local/clockspeed/bin/taiclockd
</pre>
<hr>
<h3><a name="tmda-ofmipd">A <tt>tmda-ofmipd</tt> run script</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec /usr/local/tmda/bin/tmda-ofmipd -f -d -R pop3 -p my.host.name:8025 2>&1
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="tomcat">A <tt>tomcat</tt> run script</a></h3>
(<i>SunOS</i>)
<pre>
#!/bin/sh
exec 2>&1
exec \
setuidgid apache \
/pack/tomcat/current/bin/catalina.sh run
</pre>
<hr>
<h3><a name="tor">A <tt>tor</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
exec 2>&1
exec chpst -P -u debian-tor:debian-tor tor
</pre>
<hr>
<h3><a name="vsftpd">A <tt>vsftpd</tt> run script</a></h3>
(<i>RedHat 7</i>)
<pre>
#!/bin/sh
exec 2>&1
exec /usr/local/bin/tcpserver -c30 -Xv -llocalhost \
-x/etc/tcp.ftp.cdb -uvsftpd -gvsftpd 0 ftp \
softlimit -d300000 /var/vsftpd/bin/vsftpd
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="wvdial">A <tt>wvdial</tt> run script</a></h3>
(<i>Slackware Linux 9.0</i>, the service should have a <tt>down</tt>
file, use <tt>svc -o /service/wvdial</tt> to bring up a ppp connection)
<pre>
#!/bin/sh
exec 2>&1
exec wvdial ISP
</pre>
This service needs a
<a href="http://cr.yp.to/daemontools/faq/create.html#runlog">log service</a>
to be set up.
<hr>
<h3><a name="xdm">A <tt>xdm</tt> run script</a></h3>
(<i>Linux</i>)
<pre>
#!/bin/sh
svwaitup -s 2 /service/vc-*
exec xdm -nodaemon
</pre>
<hr>
<h3><a name="xfs">A <tt>xfs</tt> run script</a></h3>
(<i>Debian sarge</i>)
<pre>
#!/bin/sh
SOCKET_DIR=/tmp/.font-unix
mkdir -p $SOCKET_DIR
chown 0:0 $SOCKET_DIR
chmod 1777 $SOCKET_DIR
exec /usr/bin/X11/xfs -nodaemon
</pre>
<hr>
<address><a href="mailto:pape-runscripts@smarden.org">
Gerrit Pape <pape@smarden.org>
</a></address>
<small>$Id$</small>
</body>
</html>
|