You are not logged in.
Hello,
I thought a systemd service to autostart a VPN tunnel would be a great idea since openvpn requires root and I want to run it on an unprivileged user account. My systemd unit looks like:
[Unit]
Description=OpenVPN tunnel to <server>
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/var/run/openvpn-client/<server>.pid
ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn-client/<server>.pid --cd /etc/openvpn/client --config <server>.conf
[Install]
WantedBy=multi-user.target
VPN works with this, but when I suspend my computer (systemctl suspend) and wake it up again, then the daemon doesn't work anymore.
What I want to achieve? The process or the whole systemd Unit needs to be restarted automatically, when the daemon dies. How to do it?
Last edited by equalizer876 (2018-10-31 20:38:45)
Offline
https://bbs.archlinux.org/viewtopic.php?id=218234 is probably why?
What does the journal say about this?
Maybe try
Restart=on-failure
"Dr. Madden, why don't the natural numbers include 0?" -me
"....... Take a philosophy course" -Dr. Madden
Offline
Maybe try
Restart=on-failure
makes no difference
After resume "journalctl -xe" only reports this about openvpn:
openvpn[10753]: Recursive routing detected, drop tun packet to [AF_INET]x.x.x.x:<port>
openvpn[10753]: Recursive routing detected, drop tun packet to [AF_INET]x.x.x.x:<port>
openvpn[10753]: Recursive routing detected, drop tun packet to [AF_INET]x.x.x.x:<port>
openvpn[10753]: Recursive routing detected, drop tun packet to [AF_INET]x.x.x.x:<port>
openvpn[10753]: Recursive routing detected, drop tun packet to [AF_INET]x.x.x.x:<port>
...
(endless strings with the same message)
It only works again when I restart the computer or type command "systemctl restart <unit>".
Last edited by equalizer876 (2018-10-29 22:25:41)
Offline
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Thanks for the link. This solved the problem after resume.
Another problem occurred: When I disable ethernet and activate it again, the problem from the first post repeats. So to cover most cases we need to restart the OpenVPN unit whenever the internet connection is lost. Which addition do I need to write into the resume unit?
Offline