#!/bin/bash -e #©keithhedger Sat 14 Jun 17:48:21 BST 2014 kdhedger68713@gmail.com # #Based on scripts and hints by #stoat http://www.linuxquestions.org/questions/user/stoat-343150/ #ReaperX7 http://www.linuxquestions.org/questions/user/reaperx7-603839/ #Here: http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-with-runit-without-sysv-4175503653/ # if [ "X${1}" = "Xuninstall" ];then rm -rf /etc/sv/atd /etc/runit/runsvdir/default/atd exit 0 fi mkdir -vp /etc/sv/atd/log cat > /etc/sv/atd/run << "EOF" #!/bin/sh #Begin atd service run file exec 2>&1 exec atd -d #End of atd service run file EOF cat > /etc/sv/atd/finish << "EOF" #!/bin/sh #Begin atd service finish file #End atd service finish file EOF cat > /etc/sv/atd/log/run << "EOF" #!/bin/sh #Begin atd log service file exec /usr/sbin/svlogd -tt /var/log/atd #End of atd log service run file EOF chmod +x /etc/sv/atd/{run,finish,log/run} mkdir -pv /var/log/atd cd /etc/runit/runsvdir/default ln -sv /etc/sv/atd atd