Merge pull request #325 from errordeveloper/issue_310
This commit is contained in:
commit
949150454c
2 files changed
+73
-1
No files matched your search
+3
-1
@@ -9,6 +9,8 @@ layout: default
|
|||||||
* [Features](features.html)
|
* [Features](features.html)
|
||||||
* [Troubleshooting](troubleshooting.html)
|
* [Troubleshooting](troubleshooting.html)
|
||||||
* [Building](building.html)
|
* [Building](building.html)
|
||||||
* [Using with Boot2Docker](boot2docker.html)
|
|
||||||
* [How it works](how-it-works.html)
|
* [How it works](how-it-works.html)
|
||||||
* [Contact information](https://github.com/zettio/weave#contact-us)
|
* [Contact information](https://github.com/zettio/weave#contact-us)
|
||||||
|
* *Installation Notes*
|
||||||
|
* [Using with boot2docker](boot2docker.html)
|
||||||
|
* [Using with systemd](systemd.html)
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
title: Using Weave with systemd
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
Having installed `weave` as per [readme][], you might wish to configure the
|
||||||
|
init daemon to start it on boot. Most recent Linux distribution releases are
|
||||||
|
shipping with [systemd][]. The information below should provide you with some
|
||||||
|
initial guidance on getting a weave service configured on systemd-based OS.
|
||||||
|
|
||||||
|
## Weave Service Unit and Configuration
|
||||||
|
|
||||||
|
A regular service unit definition for weave is shown below and you should
|
||||||
|
normally place it in `/etc/systemd/system/weave.service`.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Weave Network
|
||||||
|
Documentation=http://zettio.github.io/weave/
|
||||||
|
Requires=docker.service
|
||||||
|
After=docker.service
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=-/etc/sysconfig/weave
|
||||||
|
ExecStartPre=/usr/local/bin/weave launch $PEERS
|
||||||
|
ExecStart=/usr/bin/docker logs -f weave
|
||||||
|
SuccessExitStatus=2
|
||||||
|
ExecStop=/usr/local/bin/weave stop
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
||||||
|
To specify the addresses or names of other weave hosts to join the network
|
||||||
|
you can create the `/etc/sysconfig/weave` environment file which would be of
|
||||||
|
the following format:
|
||||||
|
|
||||||
|
PEERS="HOST1 HOST2 .. HOSTn"
|
||||||
|
|
||||||
|
You can also use the [connect][] command to add participating hosts dynamically.
|
||||||
|
|
||||||
|
Additionally, if you want to enable [encryption][] you can specify a password with
|
||||||
|
`WEAVE_PASSWORD="MakeSureThisIsSecure"` in the `/etc/sysconfig/weave` environment
|
||||||
|
file, and it will get picked up by weave on launch.
|
||||||
|
|
||||||
|
You now should be able to launch weave with
|
||||||
|
|
||||||
|
sudo systemctl start weave
|
||||||
|
|
||||||
|
To ensure weave launches after reboot, you need run
|
||||||
|
|
||||||
|
sudo systemctl enable weave
|
||||||
|
|
||||||
|
For more information on systemd, please refer to the documentation supplied
|
||||||
|
by your distribution of Linux.
|
||||||
|
|
||||||
|
## SELinux Tweaks
|
||||||
|
|
||||||
|
If your OS has SELinux enabled and you wish to run weave as a systemd unit,
|
||||||
|
then you should follow the instructions below. These instructions apply to
|
||||||
|
CentOS and RHEL as of 7.0. On Fedora 21, there is no need to do this.
|
||||||
|
|
||||||
|
Once installed `weave` in `/usr/local/bin`, you should set it's execution
|
||||||
|
context with commands shown below. You will need to have `policycoreutils-python`
|
||||||
|
package installed.
|
||||||
|
|
||||||
|
sudo semanage fcontext -a -t unconfined_exec_t -f f /usr/local/bin/weave
|
||||||
|
sudo restorecon /usr/local/bin/weave
|
||||||
|
|
||||||
|
[readme]: https://github.com/zettio/weave/blob/master/README.md#installation
|
||||||
|
[connect]: http://zettio.github.io/weave/features.html#dynamic-topologies
|
||||||
|
[systemd]: http://www.freedesktop.org/wiki/Software/systemd/
|
||||||
|
[encryption]: http://zettio.github.io/weave/how-it-works.html#crypto
|
||||||
Reference in new issue
Block a user