Skip to content

Instantly share code, notes, and snippets.

@errordeveloper
Last active February 4, 2016 19:25
Show Gist options
  • Save errordeveloper/27ef79e5b634065dc91f to your computer and use it in GitHub Desktop.
Save errordeveloper/27ef79e5b634065dc91f to your computer and use it in GitHub Desktop.
systemd units for Weave Net
[Unit]
#After=install-weave.service
After=docker.service
Description=Weave Network Router
Documentation=http://docs.weave.works/
Requires=docker.service
Requires=install-weave.service
[Service]
TimeoutStartSec=0
EnvironmentFile=-/etc/weave.%H.env
EnvironmentFile=-/etc/weave.env
ExecStartPre=/usr/local/bin/weave launch-router $WEAVE_PEERS
ExecStart=/usr/bin/docker attach weave
Restart=on-failure
ExecStop=/usr/local/bin/weave stop-router
[Install]
WantedBy=weave-network.target
# This is optional, if you need to use `weave expose`
[Unit]
After=install-weave.service
After=weave.service
After=docker.service
Documentation=http://docs.weave.works/
Requires=docker.service
Requires=install-weave.service
Requires=weave.service
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
EnvironmentFile=-/etc/weave.%H.env
EnvironmentFile=-/etc/weave.env
ExecStart=/usr/local/bin/weave expose
ExecStop=/usr/local/bin/weave hide
[Install]
WantedBy=weave-network.target
[Unit]
Description=Weave Network Setup Complete
Documentation=man:systemd.special(7)
RefuseManualStart=no
After=network-online.target
[Install]
WantedBy=multi-user.target
WEAVEPROXY_ARGS="-H 0.0.0.0:12375"
# WEAVE_PEERS="--init-peer-count <X> <head-node-name-or-addr>"
[Unit]
#After=install-weave.service
After=docker.service
Description=Weave proxy for Docker API
Documentation=http://docs.weave.works/
Requires=docker.service
Requires=install-weave.service
[Service]
EnvironmentFile=-/etc/weave.%H.env
EnvironmentFile=-/etc/weave.env
ExecStartPre=/usr/local/bin/weave launch-proxy $WEAVEPROXY_ARGS
ExecStart=/usr/bin/docker attach weaveproxy
Restart=on-failure
ExecStop=/usr/local/bin/weave stop-proxy
[Install]
WantedBy=weave-network.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment