Skip to main content
Topic: waiting on a stacked runlevel (Read 1017 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

waiting on a stacked runlevel

Hello Artix ;)

I have a general openrc question and I am running Gentoo Linux, but hopefully this forum is appropriate for the question. It is whether I can wait on a stacked runlevel before starting another one.

I probably would never have noticed, but when I run my stacked runlevel "br20" (from grub, "kernel=vmlinux...softlevel=br20"), half my services in  the previous (fabric) runlevel stop, yet when I boot just to fabric runlevel, all its servcies start just fine. I figure if I had a "wait" on fabric, ie equivalent of:

Wait util
     rc-status <SERVICE> == started, for all services in fabric runlevel

     then start services in stacked runlevel br20

This would fulfill my need. FYI, my runlevel topology

    default
       service1, service2, ...

    fabric
       default -> ../default
       service1, service2,...

    br20
       fabric -> ..fabric
       service1, service2,...


thanks in advance,


    

Re: waiting on a stacked runlevel

Reply #1
To clarify and perhaps answer my own question;

I realised the services being stopped in the fabric runlevel, were all network dependent; and stacked runlevel br20 starts a "net.br20" network interface.

So I was able to get behavior I need from wiki, eg by adding:

rc_need="!net net.eth0"

to all services in fabric runlevel; said another way?, starting a 2nd interface in a stacked runlevel impacts any prior services started that depend on "net"?

Anyhow, I still have question, is this desirable or most elegant solution, ie to update all [fabric] conf.d/<SERVICE> files to be explicit about the network interface dependencies, when openrc is running up multiple network interfaces; and perhaps there is another way to do it?

Cheers

Re: waiting on a stacked runlevel

Reply #2
You found the "needs" command but there is also a "depends" command that you can use or in fact both together if you wan't to.

Re: waiting on a stacked runlevel

Reply #3
It's not clear to me the difference between rc_need and rc_depend and when would I use either. Taking below paragraph from wiki, rc_need is described using the word depend, which I find ambiguous, is this the same for others?

The SSH service must come up with the internal network, for instance eth0 and never wlan0. Override the net dependency from /etc/init.d/sshd, and refine it to depend on net.eth0:

/etc/conf.d/sshd
rc_need="!net net.eth0"