Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] openvpn rc script dependencies
Date: Wed, 11 Apr 2018 18:39:13
Message-Id: 22082907.QBYJOS5MIg@eve
In Reply to: Re: [gentoo-user] openvpn rc script dependencies by Simon Thelen
1 On Tuesday, April 10, 2018 1:25:42 PM CEST Simon Thelen wrote:
2 > On 18-04-10 at 10:55, Christoph Böhmwalder wrote:
3 > > I was wondering how the OpenRC dependencies between start scripts work.
4 > >
5 > > Basically, I have two network interfaces on my laptop (wlp3s0 and
6 > > enp0s20u2u3 for wireless and ethernet respectively). When I start the
7 > > wireless interface service (rc-service net.wlp3s0 start) the OpenVPN
8 > > service starts and vice versa. That's great, but I didn't configure
9 > > that anywhere.
10 >
11 > What does your /etc/runlevels/ look like? Is the openvpn service in one
12 > of the runlevels? Are either of your network interfaces in one of the
13 > runlevels?
14 >
15 > > What's even worse is that when I'm not connected via WiFi (i.e.
16 >
17 > > ethernet), the VPN service won't start because net.wlp3s0 isn't started:
18 > [..]
19 >
20 > > Why would it do that, can I configure this anywhere?
21 >
22 > Also check /etc/rc.conf and try setting rc_depend_strict="NO". I do wish
23 > there were a way to modify require/provides without having to edit the
24 > init scripts themselves.
25
26 There is. You have (at least) 2 other options:
27
28 1) In the "/etc/conf.d" files (as I tend to do):
29 # grep need /etc/conf.d/postgresql-9.5
30 rc_need="netmount"
31 (This means, postgresql-9.5 needs the 'netmount' service to have started first)
32
33 # grep need /etc/conf.d/netmount
34 rc_need="net iscsid"
35 (This means, netmount needs 'net' and 'iscsid' started first)
36
37 2) /etc/rc.conf
38 See the following section in the default version:
39 ===
40 # It's possible to define extra dependencies for services like so
41 #rc_config="/etc/foo"
42 #rc_need="openvpn"
43 #rc_use="net.eth0"
44 #rc_after="clock"
45 #rc_before="local"
46 #rc_provide="!net"
47 ===
48
49 --
50 Joost