Skip to main content
Topic: I need to start a service with OpenRC, whats a Runlevel (Read 1514 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I need to start a service with OpenRC, whats a Runlevel

Hello frens, new to a non-systemd init system, i want to enable ufw.service to configure a firewall on my pc and i have OpenRC.
So on the gentoo openrc cheatsheet to enable it tells me following.
rc-update add <service> <runlevel>    --------           systemctl enable <service>

Now, i typed sudo rc-update add ufw.service _____, but whats a runlevel? when i find a wiki page about it its a bit confusing and im still clueless. Is it when it starts? or what priority or what is it? what shall i write there?

Re: I need to start a service with OpenRC, whats a Runlevel

Reply #1
i don't run openrc, but as a start, do you have ufw-openrc installed?

Re: I need to start a service with OpenRC, whats a Runlevel

Reply #2
i don't run openrc, but as a start, do you have ufw-openrc installed?
no i dont, i sudo pacman -S ufw' installed ufw. And wanted to enable it by typing the above. did not know there is a seperate version for openrc? could you pleace elaborate?

Re: I need to start a service with OpenRC, whats a Runlevel

Reply #3
well, you have ufw, so you need the alternative to sysd to get it working, hence ufw-openrc package which is in artix galaxy repo.   With that, personally i'd assume you just need to start it (as per the wiki). It's not a separate version of ufw, but is a small package that a kindly dev wrote that allows ufw to work with openrc without the need of having to write a little package that would do the same.

https://wiki.artixlinux.org/Main/OpenRC

sudo rc-service ufw start

would be my guess

Re: I need to start a service with OpenRC, whats a Runlevel

Reply #4
For the name of the service, you can look in the directory /etc/init.d which is where the scripts are installed. Also you can use pacman to list the files of the package:
Code: [Select]
$ pacman -Ql ufw-openrc
ufw-openrc /etc/
ufw-openrc /etc/conf.d/
ufw-openrc /etc/conf.d/ufw
ufw-openrc /etc/init.d/
ufw-openrc /etc/init.d/ufw
So most likely you would do something like:
Code: [Select]
$ sudo rc-update add ufw default
 * service ufw added to runlevel default
$ rc-update |grep ufw
                  ufw |      default
The rc-update command allows you to see what services are enabled and for what run levels. Generally most user stuff will go in default. If it doesn't start early enough try it in another run level like boot but as not everything else will be running then it may not work at all if it is started too early in the boot sequence, use your own judgement according to the type of service and it's purpose. As you see from the example the names don't have .service appended to them though.
Code: [Select]
$ pacman -Ql openrc |grep man8
should give you the names of the most useful OpenRC man pages if you want to study more!

 

Re: I need to start a service with OpenRC, whats a Runlevel

Reply #5
To straight up answer your question the "default" runlevel is for the majority of cases.

sysinit and boot run the services much earlier in the boot process. shutdown and nonetwork are self explanatory. These being the runlevels openrc provides out of the box, one can create more based on any condition.