Gentoo Archives: gentoo-user

From: daggs <daggs@×××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] debugging non working hotplug service
Date: Sun, 13 Sep 2020 18:24:53
Message-Id: trinity-39159ca6-ecc5-4fbc-92c7-bebf93b44054-1600021474618@3c-app-mailcom-bs13
1 Greetings,
2
3 I have a hotplug service which doesn't seems to work ok.
4 it is a tap interface created when a vm is started, the vm provide dhcp to the host.
5 here are the relevant configs:
6 /etc/conf.d/net:
7 config_veth="dhcp"
8
9 /etc/init.d/net.veth:
10 lrwxrwxrwx 1 root root 6 Sep 12 16:04 /etc/init.d/net.veth -> net.lo
11
12 /etc/rc.conf:
13 # Global OpenRC configuration settings
14
15 # Set to "YES" if you want the rc system to try and start services
16 # in parallel for a slight speed improvement. When running in parallel we
17 # prefix the service output with its name as the output will get
18 # jumbled up.
19 # WARNING: whilst we have improved parallel, it can still potentially lock
20 # the boot process. Don't file bugs about this unless you can supply
21 # patches that fix it without breaking other things!
22 #rc_parallel="NO"
23
24 # Set rc_interactive to "YES" and you'll be able to press the I key during
25 # boot so you can choose to start specific services. Set to "NO" to disable
26 # this feature. This feature is automatically disabled if rc_parallel is
27 # set to YES.
28 rc_interactive="YES"
29
30 # If we need to drop to a shell, you can specify it here.
31 # If not specified we use $SHELL, otherwise the one specified in /etc/passwd,
32 # otherwise /bin/sh
33 # Linux users could specify /sbin/sulogin
34 rc_shell=/sbin/sulogin
35
36 # Do we allow any started service in the runlevel to satisfy the dependency
37 # or do we want all of them regardless of state? For example, if net.eth0
38 # and net.eth1 are in the default runlevel then with rc_depend_strict="NO"
39 # both will be started, but services that depend on 'net' will work if either
40 # one comes up. With rc_depend_strict="YES" we would require them both to
41 # come up.
42 #rc_depend_strict="YES"
43
44 # rc_hotplug controls which services we allow to be hotplugged.
45 # A hotplugged service is one started by a dynamic dev manager when a matching
46 # hardware device is found.
47 # Hotplugged services appear in the "hotplugged" runlevel.
48 # If rc_hotplug is set to any value, we compare the name of this service
49 # to every pattern in the value, from left to right, and we allow the
50 # service to be hotplugged if it matches a pattern, or if it matches no
51 # patterns. Patterns can include shell wildcards.
52 # To disable services from being hotplugged, prefix patterns with "!".
53 #If rc_hotplug is not set or is empty, all hotplugging is disabled.
54 # Example - rc_hotplug="net.wlan !net.*"
55 # This allows net.wlan and any service not matching net.* to be hotplugged.
56 # Example - rc_hotplug="!net.*"
57 # This allows services that do not match "net.*" to be hotplugged.
58 rc_hotplug="net.enp0s20f0u7 net.veth"
59
60 # rc_logger launches a logging daemon to log the entire rc process to
61 # /var/log/rc.log
62 # NOTE: Linux systems require the devfs service to be started before
63 # logging can take place and as such cannot log the sysinit runlevel.
64 rc_logger="yes"
65
66 # Through rc_log_path you can specify a custom log file.
67 # The default value is: /var/log/rc.log
68 rc_log_path="/var/log/rc.log"
69
70 # If you want verbose output for OpenRC, set this to yes. If you want
71 # verbose output for service foo only, set it to yes in /etc/conf.d/foo.
72 #rc_verbose=no
73
74 # By default we filter the environment for our running scripts. To allow other
75 # variables through, add them here. Use a * to allow all variables through.
76 #rc_env_allow="VAR1 VAR2"
77
78 # By default we assume that all daemons will start correctly.
79 # However, some do not - a classic example is that they fork and return 0 AND
80 # then child barfs on a configuration error. Or the daemon has a bug and the
81 # child crashes. You can set the number of milliseconds start-stop-daemon
82 # waits to check that the daemon is still running after starting here.
83 # The default is 0 - no checking.
84 #rc_start_wait=100
85
86 # rc_nostop is a list of services which will not stop when changing runlevels.
87 # This still allows the service itself to be stopped when called directly.
88 #rc_nostop=""
89
90 # rc will attempt to start crashed services by default.
91 # However, it will not stop them by default as that could bring down other
92 # critical services.
93 #rc_crashed_stop=NO
94 #rc_crashed_start=YES
95
96 # Set rc_nocolor to yes if you do not want colors displayed in OpenRC
97 # output.
98 #rc_nocolor=NO
99
100 ##############################################################################
101 # MISC CONFIGURATION VARIABLES
102 # There variables are shared between many init scripts
103
104 # Set unicode to YES to turn on unicode support for keyboards and screens.
105 unicode="YES"
106
107 # This is how long fuser should wait for a remote server to respond. The
108 # default is 60 seconds, but it can be adjusted here.
109 #rc_fuser_timeout=60
110
111 # Below is the default list of network fstypes.
112 #
113 # afs ceph cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs
114 # nfs nfs4 ocfs2 shfs smbfs
115 #
116 # If you would like to add to this list, you can do so by adding your
117 # own fstypes to the following variable.
118 #extra_net_fs_list=""
119
120 ##############################################################################
121 # SERVICE CONFIGURATION VARIABLES
122 # These variables are documented here, but should be configured in
123 # /etc/conf.d/foo for service foo and NOT enabled here unless you
124 # really want them to work on a global basis.
125 # If your service has characters in its name which are not legal in
126 # shell variable names and you configure the variables for it in this
127 # file, those characters should be replaced with underscores in the
128 # variable names as shown below.
129
130 # Some daemons are started and stopped via start-stop-daemon.
131 # We can set some things on a per service basis, like the nicelevel.
132 #SSD_NICELEVEL="-19"
133 # Or the ionice level. The format is class[:data] , just like the
134 # --ionice start-stop-daemon parameter.
135 #SSD_IONICELEVEL="2:2"
136
137 # Pass ulimit parameters
138 # If you are using bash in POSIX mode for your shell, note that the
139 # ulimit command uses a block size of 512 bytes for the -c and -f
140 # options
141 #rc_ulimit="-u 30"
142
143 # It's possible to define extra dependencies for services like so
144 #rc_config="/etc/foo"
145 #rc_need="openvpn"
146 #rc_use="net.eth0"
147 #rc_after="clock"
148 #rc_before="local"
149 #rc_provide="!net"
150
151 # You can also enable the above commands here for each service. Below is an
152 # example for service foo.
153 #rc_foo_config="/etc/foo"
154 #rc_foo_need="openvpn"
155 #rc_foo_after="clock"
156
157 # Below is an example for service foo-bar. Note that the '-' is illegal
158 # in a shell variable name, so we convert it to an underscore.
159 # example for service foo-bar.
160 #rc_foo_bar_config="/etc/foo-bar"
161 #rc_foo_bar_need="openvpn"
162 #rc_foo_bar_after="clock"
163
164 # You can also remove dependencies.
165 # This is mainly used for saying which services do NOT provide net.
166 #rc_net_tap0_provide="!net"
167
168 # This is the subsystem type.
169 # It is used to match against keywords set by the keyword call in the
170 # depend function of service scripts.
171 #
172 # It should be set to the value representing the environment this file is
173 # PRESENTLY in, not the virtualization the environment is capable of.
174 # If it is commented out, automatic detection will be used.
175 #
176 # The list below shows all possible settings as well as the host
177 # operating systems where they can be used and autodetected.
178 #
179 # "" - nothing special
180 # "docker" - Docker container manager (Linux)
181 # "jail" - Jail (DragonflyBSD or FreeBSD)
182 # "lxc" - Linux Containers
183 # "openvz" - Linux OpenVZ
184 # "prefix" - Prefix
185 # "rkt" - CoreOS container management system (Linux)
186 # "subhurd" - Hurd subhurds (to be checked)
187 # "systemd-nspawn" - Container created by systemd-nspawn (Linux)
188 # "uml" - Usermode Linux
189 # "vserver" - Linux vserver
190 # "xen0" - Xen0 Domain (Linux and NetBSD)
191 # "xenU" - XenU Domain (Linux and NetBSD)
192 #rc_sys=""
193
194 # if you use openrc-init, which is currently only available on Linux,
195 # this is the default runlevel to activate after "sysinit" and "boot"
196 # when booting.
197 #rc_default_runlevel="default"
198
199 # on Linux and Hurd, this is the number of ttys allocated for logins
200 # It is used in the consolefont, keymaps, numlock and termencoding
201 # service scripts.
202 rc_tty_number=12
203
204 ##############################################################################
205 # LINUX CGROUPS RESOURCE MANAGEMENT
206
207 # This sets the mode used to mount cgroups.
208 # "hybrid" mounts cgroups version 2 on /sys/fs/cgroup/unified and
209 # cgroups version 1 on /sys/fs/cgroup.
210 # "legacy" mounts cgroups version 1 on /sys/fs/cgroup
211 # "unified" mounts cgroups version 2 on /sys/fs/cgroup
212 #rc_cgroup_mode="hybrid"
213
214 # This is a list of controllers which should be enabled for cgroups version 2.
215 # If hybrid mode is being used, controllers listed here will not be
216 # available for cgroups version 1.
217 # This is a global setting.
218 #rc_cgroup_controllers=""
219
220 # This variable contains the cgroups version 2 settings for your services.
221 # If this is set in this file, the settings will apply to all services.
222 # If you want different settings for each service, place the settings in
223 # /etc/conf.d/foo for service foo.
224 # The format is to specify the setting and value followed by a newline.
225 # Multiple settings and values can be specified.
226 # For example, you would use this to set the maximum memory and maximum
227 # number of pids for a service.
228 #rc_cgroup_settings="
229 #memory.max 10485760
230 #pids.max max
231 #"
232 #
233 # For more information about the adjustments that can be made with
234 # cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
235 # source tree.
236 #rc_cgroup_settings=""
237
238 # This switch controls whether or not cgroups version 1 controllers are
239 # individually mounted under
240 # /sys/fs/cgroup in hybrid or legacy mode.
241 #rc_controller_cgroups="YES"
242
243 # The following setting turns on the memory.use_hierarchy setting in the
244 # root memory cgroup for cgroups v1.
245 # It must be set to yes in this file if you want this functionality.
246 #rc_cgroup_memory_use_hierarchy="NO"
247
248 # The following settings allow you to set up values for the cgroups version 1
249 # controllers for your services.
250 # They can be set in this file;, however, if you do this, the settings
251 # will apply to all of your services.
252 # If you want different settings for each service, place the settings in
253 # /etc/conf.d/foo for service foo.
254 # The format is to specify the names of the settings followed by their
255 # values. Each variable can hold multiple settings.
256 # For example, you would use this to set the cpu.shares setting in the
257 # cpu controller to 512 for your service.
258 # rc_cgroup_cpu="
259 # cpu.shares 512
260 # "
261 #
262 # For more information about the adjustments that can be made with
263 # cgroups version 1, see Documentation/cgroups-v1/* in the linux kernel
264 # source tree.
265
266 # Set the blkio controller settings for this service.
267 #rc_cgroup_blkio=""
268
269 # Set the cpu controller settings for this service.
270 #rc_cgroup_cpu=""
271
272 # Add this service to the cpuacct controller (any value means yes).
273 #rc_cgroup_cpuacct=""
274
275 # Set the cpuset controller settings for this service.
276 #rc_cgroup_cpuset=""
277
278 # Set the devices controller settings for this service.
279 #rc_cgroup_devices=""
280
281 # Set the hugetlb controller settings for this service.
282 #rc_cgroup_hugetlb=""
283
284 # Set the memory controller settings for this service.
285 #rc_cgroup_memory=""
286
287 # Set the net_cls controller settings for this service.
288 #rc_cgroup_net_cls=""
289
290 # Set the net_prio controller settings for this service.
291 #rc_cgroup_net_prio=""
292
293 # Set the pids controller settings for this service.
294 #rc_cgroup_pids=""
295
296 # Set this to YES if you want all of the processes in a service's cgroup
297 # killed when the service is stopped or restarted.
298 # Be aware that setting this to yes means all of a service's
299 # child processes will be killed. Keep this in mind if you set this to
300 # yes here instead of for the individual services in
301 # /etc/conf.d/<service>.
302 # To perform this cleanup manually for a stopped service, you can
303 # execute cgroup_cleanup with /etc/init.d/<service> cgroup_cleanup or
304 # rc-service <service> cgroup_cleanup.
305 # The process followed in this cleanup is the following:
306 # 1. send stopsig (sigterm if it isn't set) to all processes left in the
307 # cgroup immediately followed by sigcont.
308 # 2. Send sighup to all processes in the cgroup if rc_send_sighup is
309 # yes.
310 # 3. delay for rc_timeout_stopsec seconds.
311 # 4. send sigkill to all processes in the cgroup unless disabled by
312 # setting rc_send_sigkill to no.
313 # rc_cgroup_cleanup="NO"
314
315 # If this is yes, we will send sighup to the processes in the cgroup
316 # immediately after stopsig and sigcont.
317 #rc_send_sighup="NO"
318
319 # This is the amount of time in seconds that we delay after sending sigcont
320 # and optionally sighup, before we optionally send sigkill to all
321 # processes in the # cgroup.
322 # The default is 90 seconds.
323 #rc_timeout_stopsec="90"
324
325 # If this is set to no, we do not send sigkill to all processes in the
326 # cgroup.
327 #rc_send_sigkill="YES"
328
329 rc-status hotplugged:
330 Runlevel: hotplugged
331 net.veth [ started ]
332
333 at the end, in order to get ip, I must login physically and restart the service.
334 how can I debug this?
335
336 Thanks,
337
338 Dagg.