mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
Adapt VPN service to mimic that of our devices + mount systemd in the supervisor
This commit is contained in:
parent
cd9daa8a8b
commit
d6154b802d
14
tools/dind/config/services/openvpn-resin.service
Normal file
14
tools/dind/config/services/openvpn-resin.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=OpenVPN Application On Resin
|
||||
Wants=prepare-openvpn.service
|
||||
After=syslog.target network.target prepare-openvpn.service
|
||||
|
||||
[Service]
|
||||
PrivateTmp=true
|
||||
Type=forking
|
||||
PIDFile=/var/run/openvpn/resin.pid
|
||||
ExecStartPre=-/bin/mkdir -p /var/run/openvpn
|
||||
ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/resin.pid --cd /etc/openvpn/ --config client.conf
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,6 +0,0 @@
|
||||
[Service]
|
||||
WorkingDirectory=/usr/src/app
|
||||
EnvironmentFile=/usr/src/app/config/env
|
||||
ExecStartPre=/usr/src/app/vpn-init
|
||||
TimeoutStartSec=0
|
||||
Restart=always
|
13
tools/dind/config/services/prepare-openvpn.service
Normal file
13
tools/dind/config/services/prepare-openvpn.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Prepare OpenVPN Application On Resin
|
||||
Before=openvpn@client.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
WorkingDirectory=/usr/src/app
|
||||
EnvironmentFile=/usr/src/app/config/env
|
||||
ExecStart=/usr/src/app/vpn-init
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,8 +1,8 @@
|
||||
[Unit]
|
||||
Description=resin-supervisor-dind
|
||||
Requires=confd.service docker.service openvpn@client.service
|
||||
Requires=confd.service docker.service openvpn-resin.service
|
||||
After=confd.service
|
||||
Before=openvpn@client.service
|
||||
Before=openvpn-resin.service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/usr/src/app
|
||||
@ -24,6 +24,7 @@ ExecStart=/bin/bash -c 'source /usr/src/app/resin-vars && \
|
||||
-v /var/log/supervisor-log:/var/log \
|
||||
-v /:/mnt/root \
|
||||
-v /etc/resolv.conf:/etc/resolv.conf:rw \
|
||||
-v /var/run/dbus:/var/run/dbus \
|
||||
-e "API_ENDPOINT=$API_ENDPOINT" \
|
||||
-e "REGISTRY_ENDPOINT=$REGISTRY_ENDPOINT" \
|
||||
-e "PUBNUB_SUBSCRIBE_KEY=$PUBNUB_SUBSCRIBE_KEY" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user