blob: 0a96b5f93a89c5540e11cbb78717640303592be0 (
plain) (
blame)
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
|
#!/bin/sh -e
# xmksv [-l] [NEWSVDIR...] - create new runit service templates
if [ "$1" = "-l" ]; then
MKLOG=1
shift
fi
cd ${SVDIR:-/etc/sv}
for SRV; do
mkdir "$SRV"
touch "$SRV/down"
echo "#!/bin/sh" | install -m755 /dev/stdin "$SRV/run"
if [ -w /run/runit ]; then
ln -s /run/runit/supervise."$(printf %s "$SRV" | tr / -)" \
"$SRV/supervise"
fi
if [ -n "$MKLOG" ]; then
mkdir "$SRV/log"
cat <<EOF | install -m755 /dev/stdin "$SRV/log/run"
#!/bin/sh
exec vlogger -t $SRV -p daemon
EOF
if [ -w /run/runit ]; then
ln -s /run/runit/supervise."$(printf %s "$SRV/log" | tr / -)" \
"$SRV/log/supervise"
fi
fi
done
|