Skip to content

Commit

Permalink
Adopt SystemD for initialization, not Upstart
Browse files Browse the repository at this point in the history
  • Loading branch information
joeduffy committed Dec 15, 2015
1 parent f3aa383 commit 3aa72d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion res/LATEST
@@ -1,2 +1,2 @@
v0.1
v0.2

15 changes: 15 additions & 0 deletions res/blocker.service
@@ -0,0 +1,15 @@
[Unit]
Description=Blocker daemon
After=docker.service
Requires=docker.service

[Service]
Restart=on-failure
StandardOutput=tty
StandardError=tty
Environment=AWS_SHARED_CREDENTIALS_FILE=/etc/blocker/.aws/credentials
ExecStart=/usr/local/bin/blocker

[Install]
WantedBy=multi-user.target

7 changes: 4 additions & 3 deletions res/get.sh
Expand Up @@ -22,7 +22,7 @@ fi

version=`curl -sSL https://raw.githubusercontent.com/joeduffy/blocker/master/res/LATEST`
filename="blocker.$version.Linux-x86_64.tar.gz"
download="https://github.com/joeduffy/blocker/releases/download/v0.1/$filename"
download="https://github.com/joeduffy/blocker/releases/download/$version/$filename"

echo "Downloading Blocker $version..."
$sh_c "curl -sSL $download | tar xz"
Expand All @@ -33,10 +33,11 @@ $sh_c 'chmod +x /usr/local/bin/blocker'
$sh_c 'mkdir -p /etc/blocker/.aws'
$sh_c 'mkdir -p /etc/docker/plugins'
$sh_c 'echo "unix:///var/run/blocker.sock" > /etc/docker/plugins/blocker.spec'
$sh_c 'mv blocker.conf /etc/init/blocker.conf'
$sh_c 'mv blocker.service /etc/systemd/system/blocker.service'

echo "Starting the Blocker service..."
$sh_c 'service blocker start'
$sh_c 'systemctl enable /etc/systemd/system/blocker.service'
$sh_c 'systemctl start blocker.service'

echo "Done."

0 comments on commit 3aa72d7

Please sign in to comment.