Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd starting my openvpn client
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 939
Location: USA

PostPosted: Sat Mar 07, 2020 2:19 pm    Post subject: systemd starting my openvpn client Reply with quote

I created a systemd vpn service. The service starts on bootup, but it fails to setup the default route "SIOCADDRT: Network is unreachable". "After" what service should my service start?
Code:
[Unit]
Description=VPN
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
to always restart on exit:
Restart=always
RestartSec=5
User=root
ExecStart=/bin/bash /root/openvpn_vpn_random.sh

[Install]
WantedBy=multi-user.target

_________________
cya
    ©®0t
Back to top
View user's profile Send private message
Banana
l33t
l33t


Joined: 21 May 2004
Posts: 659
Location: Germany

PostPosted: Mon Mar 09, 2020 10:17 am    Post subject: Reply with quote

Hello Cr0t.

Make sure your network is ready
_________________
My personal space
Back to top
View user's profile Send private message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 939
Location: USA

PostPosted: Fri Apr 03, 2020 5:52 pm    Post subject: Reply with quote

Code:
ExecStartPre=sleep 5
That did the trick.
_________________
cya
    ©®0t
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 16022

PostPosted: Sat Apr 04, 2020 12:55 am    Post subject: Reply with quote

What if someday the network takes 7 seconds to be ready?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum