-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #204 from kylemanna/docs_systemd
Document systemd service usage
- Loading branch information
Showing
3 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Docker + OpenVPN systemd Service | ||
|
||
The systemd service aims to make the update and invocation of the | ||
`docker-openvpn` container seamless. It automatically downloads the latest | ||
`docker-openvpn` image and instantiates a Docker container with that image. At | ||
shutdown it cleans-up the old container. | ||
|
||
In the event the service dies (crashes, or is killed) systemd will attempt to | ||
restart the service every 10 seconds until the service is stopped with | ||
`systemctl stop [email protected]`. | ||
|
||
A number of IPv6 hacks are incorporated to workaround Docker shortcomings and | ||
are harmless for those not using IPv6. | ||
|
||
To use and enable automatic start by systemd: | ||
|
||
1. Create a Docker volume container named `ovpn-data-NAME` where `NAME` is the | ||
user's choice to describe the use of the container. In the example | ||
configuration given in the [README](/README.md) `NAME=data`. | ||
2. Initialize the data container according to the [docker-openvpn | ||
README](/README.md), but don't start the container. Stop the Docker | ||
container if started. | ||
3. Download the [[email protected]](https://raw.githubusercontent.com/kylemanna/docker-openvpn/master/init/docker-openvpn%40.service) | ||
file to `/etc/systemd/system`: | ||
|
||
curl -L https://raw.githubusercontent.com/kylemanna/docker-openvpn/master/init/docker-openvpn%40.service | sudo tee /etc/systemd/system/[email protected] | ||
|
||
4. Enable and start the service with: | ||
|
||
systemctl enable --now [email protected] | ||
|
||
5. Verify service start-up with: | ||
|
||
systemctl status [email protected] | ||
journalctl --unit [email protected] | ||
|
||
For more information, see the [systemd manual pages](https://www.freedesktop.org/software/systemd/man/index.html). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
# | ||
# Docker + OpenVPN systemd service | ||
# | ||
# Author: Kyle Manna <[email protected]> | ||
# Source: https://github.com/kylemanna/docker-openvpn | ||
# | ||
# This service aims to make the update and invocation of the docker-openvpn | ||
# container seemless. It automatically downloads the latest docker-openvpn | ||
# image and instantiates a Docker container with that image. At shutdown it | ||
# cleans-up the old container. | ||
# | ||
# In the event the service dies (crashes, or is killed) systemd will attempt | ||
# to restart the service every 10 seconds until the service is stopped with | ||
# `systemctl stop docker-openvpn@NAME`. | ||
# | ||
# A number of IPv6 hacks are incorporated to workaround Docker shortcomings and | ||
# are harmless for those not using IPv6. | ||
# | ||
# To use: | ||
# 1. Create a Docker volume container named `ovpn-data-NAME` where NAME is the | ||
# user's choice to describe the use of the container. | ||
# 2. Initialize the data container according to the docker-openvpn README, but | ||
# don't start the container. Stop the docker container if started. | ||
# 3. Download this service file to /etc/systemd/service/[email protected] | ||
# 4. Enable and start the service template with: | ||
# `systemctl enable --now [email protected]` | ||
# 5. Verify service start-up with: | ||
# `systemctl status [email protected]` | ||
# `journalctl --unit [email protected]` | ||
# | ||
# For more information, see the systemd manual pages. | ||
# | ||
[Unit] | ||
Description=OpenVPN Docker Container | ||
Documentation=https://github.com/kylemanna/docker-openvpn | ||
|