[opensuse] 42.3: I had to rework openvpn@.service
I installed openvpn in a fresh 42.3 and copied the configuration files from a working installation into /etc/openvpn/ . I then tried with Yast to enable and start the openvpn@.service provided by the package, This failed with message Failed to get properties: Unit name openvpn@.service is not valid. So I defined service unit /usr/lib/systemd/system/openvpn.service (no @) [Unit] Description=OpenVPN tunneling daemon instance using /etc/openvpn/server.conf After=network.target PartOf=openvpn.target [Service] Type=forking PrivateTmp=true PIDFile=/var/run/openvpn/server.pid ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/server.pid --cd /etc/openvpn/ --config server.conf ExecReload=/sbin/killproc -p /var/run/openvpn/server.pid -HUP /usr/sbin/openvpn [Install] WantedBy=multi-user.target openvpn.target This service unit is the same as openvpn@.service, but explicitly specifies where the configuration files are and where the pid goes. I enabled openvpn.service with Yast and successfully started it with command systemctl start openvpn.service . Why does the package provide the extra %i and %I engineering which doesn't work? Roger -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Aug 31, 2017 at 02:31:47PM +0200, Roger Price wrote:
I installed openvpn in a fresh 42.3 and copied the configuration files from a working installation into /etc/openvpn/ . I then tried with Yast to enable and start the openvpn@.service provided by the package, This failed with message
Failed to get properties: Unit name openvpn@.service is not valid.
So I defined service unit /usr/lib/systemd/system/openvpn.service (no @)
[Unit] Description=OpenVPN tunneling daemon instance using /etc/openvpn/server.conf After=network.target PartOf=openvpn.target
[Service] Type=forking PrivateTmp=true PIDFile=/var/run/openvpn/server.pid ExecStart=/usr/sbin/openvpn --daemon --suppress-timestamps --writepid /var/run/openvpn/server.pid --cd /etc/openvpn/ --config server.conf ExecReload=/sbin/killproc -p /var/run/openvpn/server.pid -HUP /usr/sbin/openvpn
[Install] WantedBy=multi-user.target openvpn.target
This service unit is the same as openvpn@.service, but explicitly specifies where the configuration files are and where the pid goes.
I enabled openvpn.service with Yast and successfully started it with command systemctl start openvpn.service .
Why does the package provide the extra %i and %I engineering which doesn't work?
Actually the @ is meant for having variable configurations in those snippets. E.g. having /etc/openvpn/foo.conf and then doing systemctl start openvpn@foo systemctl enable openvpn@foo can be used too. Ciao, Marcus -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Marcus Meissner
-
Roger Price