Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
install daemontools (AmazonLinux2,CentOS7, etc...)
#!/bin/bash
set -e
set -o pipefail
cd "$(mktemp -d)"
trap "rm -rf $PWD" EXIT
# install daemontools
curl -s https://cr.yp.to/daemontools/daemontools-0.76.tar.gz | tar xz
cd ./admin/daemontools-0.76/
sed -i 's!^gcc !gcc -include /usr/include/errno.h !' src/conf-cc
./package/install
## replace "symlinks in /usr/local/bin" to binaries
for f in $(<package/commands); do
mv command/$f /usr/local/bin/$f && ln -sfn /usr/local/bin/$f /command/$f
done
# install service
cat >/etc/systemd/system/daemontools.service <<EOF
[Unit]
Description=daemontools Start supervise
After=getty.target
[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStart=/command/svscanboot /dev/ttyS0
TimeoutSec=0
[Install]
WantedBy=multi-user.target
EOF
systemctl enable daemontools
systemctl start daemontools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment