PLATFORM_IF_MATCH(linux)
PLATFORM_ELSE
PLATFORM_ENDIF
mv package/run package/run.orig
mv package/run.inittab package/run.inittab.orig
mv package/boot.inittab package/boot.inittab.orig
mv package/run.rclocal package/run.rclocal.orig
mv package/boot.rclocal package/boot.rclocal.orig
test -d var || mkdir var
test -d var/svc.d || mkdir var/svc.d
test -d var/svc.d/svscan || mkdir var/svc.d/svscan
test -d var/svc.d/svscan/log || mkdir var/svc.d/svscan/log
# Make "this encap is installed" sentinal file available in /usr/local/var/encap
test -d var/encap || mkdir var/encap
touch var/encap/${ENCAP_PKGNAME}
&1
exec /command/multilog t /usr/local/var/multilog/svscan
]]>
/dev/null 2>&1
for log_dir in "$SERVICES"/*/log "$SERVICES"/.svscan/log; do
if [ -d "$log_dir" ] \
&& svok "$log_dir" \
&& svstat "$log_dir" | grep -q ": up"
then
svc -ox "$log_dir"
fi
done
for service_dir in "$SERVICES"/*; do
if [ -d "$service_dir" ] \
&& svok "$service_dir" \
&& svstat "$service_dir" | grep -q ": up"
then
[ -x "$service_dir"/shutdown ] && "$service_dir"/shutdown
svc -dx "$service_dir"
fi
done
[ "$1" = "start" ] && exec env - PATH=$PATH svscan "$SERVICES"
]]>
/usr/local/var/svc.d/svscan ...'
ln -s /usr/local/var/svc.d/svscan /service/.svscan
if test -r /etc/inittab
then
/command/setlock /etc/inittab package/run.inittab
else
/command/setlock /etc/rc.local package/run.rclocal
fi
]]>
/dev/null
then
echo 'inittab contains an svscan.rc line. I assume that svscan is already running.
'
else
echo 'Adding svscan.rc to inittab...'
rm -f /etc/inittab'{new}'
cat /etc/inittab package/boot.inittab > /etc/inittab'{new}'
mv -f /etc/inittab'{new}' /etc/inittab
kill -HUP 1
echo 'init should start svscan now.'
fi
]]>
/dev/null
then
echo 'Backing up inittab to .inittab.backup...'
rm -f /etc/.inittab.backup
cp -f /etc/inittab /etc/.inittab.backup
echo 'Removing svscan lines from inittab...'
rm -f /etc/inittab'{new}'
grep -v svscan /etc/inittab > /etc/inittab'{new}'
mv -f /etc/inittab'{new}' /etc/inittab
kill -HUP 1
echo 'init should stop svscan now.'
else
echo 'inittab does not contain an svscan.rc line.
'
fi
]]>
/tmp/svscan-start.log 2>&1
SZ:S016:once:/command/svscan.rc stop /tmp/svscan-stop.log 2>&1
]]>
/dev/null
then
echo 'rc.local contains an svscan.rc line. I assume that svscan is already running
.'
else
echo 'Adding svscan.rc to /etc/rc.local...'
rm -f /etc/rc.local'{new}'
cat /etc/rc.local package/boot.rclocal > /etc/rc.local'{new}'
mv -f /etc/rc.local'{new}' /etc/rc.local
echo 'Reboot now to start svscan.'
fi
]]>
/dev/null
then
echo 'Backing up rc.local to .rc.local.backup...'
rm -f /etc/.rc.local.backup
cp -f /etc/rc.local /etc/.rc.local.backup
echo 'Removing svscan lines from /etc/rc.local...'
rm -f /etc/rc.local'{new}'
grep -v svscan /etc/rc.local > /etc/rc.local'{new}'
mv -f /etc/rc.local'{new}' /etc/rc.local
echo 'Reboot now to stop svscan.'
else
echo 'rc.local does not contain an svscan.rc line.
.'
fi
]]>
$LOG 2>&1
printf "Running daemontools postinstall script...\n"
date
test -d /usr/local/var || mkdir /usr/local/var
test -d /usr/local/var/multilog || mkdir /usr/local/var/multilog
test -d /usr/local/var/multilog/svscan || mkdir /usr/local/var/multilog/svscan
test -h /command || ln -s /usr/local/encap/daemontools-0.76/bin /command
cd /usr/local/encap/daemontools-0.76 && ./package/run
printf "Finished daemontools postinstall script.\n"
]]>
description daemontools - a collection of tools for managing UNIX services
exclude src
exclude package