summaryrefslogtreecommitdiff
blob: 6bc215da311ca733fc414e3b3b7d515eb01c30f1 (plain)
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
# config-svc-smbd+nmbd
config_install() {

for x in smbd nmbd
do
	dodir /var/lib/supervise/services/${x}/log
	chmod +t ${D}var/lib/supervise/services/${x}

# install svc-run stub - pretty lame eh
rm -f ${T}/config.config
cat > ${T}/config.config <<EOF
#!/bin/sh
mypid=\`pidof /usr/sbin/${x}\`
if [ -z "\$mypid" ] ; then
	/usr/sbin/${x} -l ./log/logfifo
	sleep 2
	mypid=\`pidof /usr/sbin/${x}\`
fi
exec /usr/bin/watchpid $mypid
EOF
	exeinto /var/lib/supervise/services/${x}
	newexe ${T}/config.config run


# install svc-log stub
rm -f ${T}/config.config
cat > ${T}/config.config <<EOF
#!/bin/sh
if [ ! -p logfifo ] ; then
	rm -f logfifo
	mknod logfifo p
fi
exec multilog t ./${x}-log < logfifo
EOF
	exeinto /var/lib/supervise/services/${x}/log
	newexe ${T}/config.config run


done
}