Last active
May 21, 2020 05:32
-
-
Save kawaz/a3645c4fa62031af0dfc46074c101d33 to your computer and use it in GitHub Desktop.
install daemontools (AmazonLinux2,CentOS7, etc...)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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