Skip to content

Commit 861ed05

Browse files
authored
Merge pull request #254 from buchdag/buchdag-systemd.md
Clarify and complete systemd.md
2 parents ce690e5 + e4821ec commit 861ed05

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/systemd.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,29 @@ are harmless for those not using IPv6.
1515
To use and enable automatic start by systemd:
1616

1717
1. Create a Docker volume container named `ovpn-data-NAME` where `NAME` is the
18-
user's choice to describe the use of the container. In the example
19-
configuration given in the [README](/README.md) `NAME=data`.
20-
2. Initialize the data container according to the [docker-openvpn
21-
README](/README.md), but don't start the container. Stop the Docker
22-
container if started.
18+
user's choice to describe the use of the container. In this example
19+
configuration, `NAME=example`.
20+
21+
OVPN_DATA="ovpn-data-example"
22+
docker volume create --name $OVPN_DATA
23+
24+
2. Initialize the data container, but don't start the container :
25+
26+
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COM
27+
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
28+
2329
3. Download the [[email protected]](https://raw.githubusercontent.com/kylemanna/docker-openvpn/master/init/docker-openvpn%40.service)
2430
file to `/etc/systemd/system`:
2531

2632
curl -L https://raw.githubusercontent.com/kylemanna/docker-openvpn/master/init/docker-openvpn%40.service | sudo tee /etc/systemd/system/[email protected]
2733

2834
4. Enable and start the service with:
2935

30-
systemctl enable --now docker-openvpn@NAME.service
36+
systemctl enable --now docker-openvpn@example.service
3137

3238
5. Verify service start-up with:
3339

34-
systemctl status docker-openvpn@NAME.service
35-
journalctl --unit docker-openvpn@NAME.service
40+
systemctl status docker-openvpn@example.service
41+
journalctl --unit docker-openvpn@example.service
3642

3743
For more information, see the [systemd manual pages](https://www.freedesktop.org/software/systemd/man/index.html).

0 commit comments

Comments
 (0)