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: 945
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
Moderator
Moderator


Joined: 21 May 2004
Posts: 1859
Location: Germany

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

Hello Cr0t.

Make sure your network is ready
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 945
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
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23062

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