openvpn-client@client.service taking very long to start

Ask questions about Arch Linux ARM. Please search before making a new topic.

openvpn-client@client.service taking very long to start

Postby mobrien » Thu Nov 26, 2020 1:47 pm

Hi All,

I use a raspberry 3b+ as a picture frame. It auto logins a dedicated user via
$this->bbcode_second_pass_code('', '[Service]
Type=simple
ExecStart=
ExecStart=-/usr/bin/agetty --autologin USERNAME --noclear %I $TERM')

and then ".xinitrc" launches the the actual "picture frame app" without using a window manager.

All this used to work until I enabled "openvpn-client@client.service".

The Raspberry was connected via wlan0 to the local network and the following logs where recorded when logged in via ssh. Network was up and working, though...

When manually starting "openvpn-client@client.service" logs looked like this:

$this->bbcode_second_pass_code('', '
Nov 26 13:17:35 TeleFrameFD systemd[1]: Created slice system-openvpn\x2dclient.slice.
Nov 26 13:17:35 TeleFrameFD systemd[1]: Starting Wait for Network to be Configured...
')
Here it gets stuck for roughly 90 seconds and then it continues with ...
$this->bbcode_second_pass_code('', '
Nov 26 13:19:35 TeleFrameFD systemd-networkd-wait-online[856]: Event loop failed: Connection timed out
Nov 26 13:19:35 TeleFrameFD systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Nov 26 13:19:35 TeleFrameFD audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=?>
Nov 26 13:19:35 TeleFrameFD systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Nov 26 13:19:35 TeleFrameFD systemd[1]: Failed to start Wait for Network to be Configured.
Nov 26 13:19:35 TeleFrameFD kernel: audit: type=1130 audit(1606393175.090:56): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" h>
Nov 26 13:19:35 TeleFrameFD systemd[1]: Reached target Network is Online.
Nov 26 13:19:35 TeleFrameFD systemd[1]: Starting OpenVPN tunnel for XXXXXXX...

')

... and "dev tap" it up within the fraction of a second. I now can manually stop and start the openvpn service as often as I want, both stopping and starting happens almost instantaneously.

When having "openvpn-client@client.service" enabled to launch it during boot the picture displaying app does not start. ".xinitrc" apparently is not executed.

I in no way understand the underlying processes well enough to work out what is going wrong here.

Could anyone please advise?!

Thank You for any help!
mobrien
 
Posts: 4
Joined: Thu Jan 12, 2017 1:11 pm

Re: openvpn-client@client.service taking very long to start

Postby mobrien » Thu Nov 26, 2020 8:48 pm

I'm still hoping for someone to shade some light on this...

How I managed to work around the problem:

I sped up the "Starting Wait for Network to be Configured..." by adding "--ignore=eth0" to ExecStart=/usr/lib/systemd/systemd-networkd-wait-online in systemd-networkd-wait-online.service

$this->bbcode_second_pass_code('', 'ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --ignore=eth0')

Still, `.xinitrc` was not executed and the picture displaying app didn't launch. I had to delay openvpn-client@.service by a minute. Adding
$this->bbcode_second_pass_code('', '
ExecStartPre=/bin/sleep 60
')
to the [Service] section of openvpn-client@.service had no effect. Introducing a systemd timer openvpn-client@.timer

$this->bbcode_second_pass_code('', '
[Unit]
Description=Delay start-up

[Timer]
OnBootSec=1min

[Install]
WantedBy=timers.target
')

and enabling it instead of the actual service file did the trick.

I'd be still more than happy if someone could explain what is wrong with my set-up.
mobrien
 
Posts: 4
Joined: Thu Jan 12, 2017 1:11 pm

Re: openvpn-client@client.service taking very long to start

Postby technosf » Sun Dec 06, 2020 6:13 pm

There was a major update from 2.4.9 to 2.5.0...

I'm diagnosing my own setup now - I think the issue is going to be your config file, not the systemd service file.
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 130
Joined: Sat Jan 08, 2011 10:54 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 8 guests

cron