Last active
August 29, 2015 14:08
-
-
Save tkuchiki/cf2dcf51319bf26f7be0 to your computer and use it in GitHub Desktop.
serf
This file contains hidden or 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
yum install -y curl unzip rpm-build rpmdevtools | |
curl -L -O https://dl.bintray.com/mitchellh/serf/0.6.3_linux_amd64.zip | |
unzip 0.6.3_linux_amd64.zip | |
mv serf /usr/local/bin | |
rpmdev-setuptree | |
curl -L -O http://www.qmailtoaster.com/download/stable/daemontools-toaster-0.76-1.3.6.src.rpm | |
rpmbuild --rebuild daemontools-toaster-0.76-1.3.6.src.rpm | |
rpm -ivh rpmbuild/RPMS/x86_64/daemontools-toaster-0.76-1.3.6.x86_64.rpm | |
useradd -r serf | |
mkdir /var/lib/serf | |
chown serf: /var/lib/serf | |
mkdir -p /usr/local/serf/service/log | |
cat <<'EOF' > /etc/init/daemontools.conf | |
start on runlevel [0123456] | |
respawn | |
exec /usr/bin/svscanboot | |
EOF | |
start daemontools | |
chown -R serf: /usr/local/serf | |
cat <<'EOF' > /usr/local/serf/service/run | |
#!/bin/sh | |
set -e | |
exec 2>&1 | |
exec setuidgid serf /usr/local/bin/serf agent \ | |
-node=$(hostname) \ | |
EOF | |
cat <<'EOF' > /usr/local/serf/service/log/run | |
#!/bin/sh | |
set -e | |
exec 2>&1 | |
exec setuidgid serf multilog t s16777216 n10 ./ | |
EOF | |
chmod +x /usr/local/serf/service/run | |
chmod +x /usr/local/serf/service/log/run | |
ln -s /usr/local/serf/service /service/serf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment