Skip to main content
Topic: Debating Artix + s6/runit. Convince me! (Read 837 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

Debating Artix + s6/runit. Convince me!

Hello, peeps. I'm a relatively fresh user who's been venturing into Linux for a decent few years now, and I've been spending most of my time on my Laptop's Debian-based distribution with Systemd.

I've recently decided after the use I've been giving it, I'd love to try out Arch Linux. The concept of having a nice unified repo with the AUR/Chaotic AUR expanding it beyond Arch maintainers and some certain additional repos I'll be adding would be great for my experience here.

However, I've also decided that I think I'd potentially want to leap into a less complex, more versatile init system, to make my experience smoother and feel like I have a higher degree of control over my services. However, I'm quite scared to do that, as I have grown very accustomed to services being automatically built for me as most applications use Systemd by default. All these other various init systems require me to convert those .service files manually.

I specifically thought of using the more recent alternative presented on this distro; s6. It seems to be more versatile and quicker than runit, with a decent degree of simplicity. However;

- The documentation and Man pages leave me confused as I want to know, put simply, how to make services (without having to dive deep into what every piece of this supervision/service system can do). I can't seem to find that alone
- The guides outside of those Man pages are basically nonexistent
- This leaves me in a state of scratching my head trying to think up how I can connect the dots and understand the capabilities of it fully


The configuring of services is going to be a difficult thing for me. I am thinking of running various services on my daily driver, because I am learning Cyber Sec and pentesting, so my tools from the Blackarch repo, like Neo4j or Metasploit's database, will need to be coded all over again I'd imagine. I want to do this as hassle-free as possible, so I can quickly get back to learning what my current focus is, and look into this more passively as time goes on.


Should I go for runit instead? Is there a way I could still roll with s6? Is this even the distro for me, or does my circumstance mean I am better off running on Arch with Systemd instead?

Re: Debating Artix + s6/runit. Convince me!

Reply #1
If I were you, I'd use BlackArch or Debian based Kali/Parrot directly.

Artix is all about different init systems. If systemd doesn't bother you, why switch?

If you really want to try different init systems available in Artix, dinit is probably the easiest to learn and use. OpenRC has a long tracking record and is production ready. Runit is also easy to use. S6 is very modular and powerful but needs a little more time and effort to learn. In terms of dependency handling, dinit and S6 are better. Artix has a wiki page for each init system. The Artix dev has done a great job putting together what you would need to know before you can actually use the system. In each wiki section, external links are also included. You can navigate through to find information in case you need to learn more.

Depends on what you want to achieve here, if your focus is on Cyber Sec/pentesting, any init system (including systemd) can bring your system up. No need to worry about how and how long they bring your system up.

Re: Debating Artix + s6/runit. Convince me!

Reply #2
If security is an issue then not using systemd is a good start. Runit and OpenRC are well established and reliable, most services already exist in the repos (likewise for other inits) so it's unlikely you will need to write your own services unless you find something really obscure or write your own apps. For OpenRC the man pages include a good starter guide:
https://github.com/OpenRC/openrc/blob/master/man/openrc-run.8
You can probably find a more readable example online than the raw man page code but I linked that as I'm sure it's the latest version - if you copy paste it somewhere you can read it using man -l if you want. Most of the fields in the example won't be needed either, it's giving a run down of possible values and the kind of shell logic you can include, if you look at some examples of init scripts they are mostly just a few lines long.

Re: Debating Artix + s6/runit. Convince me!

Reply #3
If I were you, I'd use BlackArch or Debian based Kali/Parrot directly.

Artix is all about different init systems. If systemd doesn't bother you, why switch?

If you really want to try different init systems available in Artix, dinit is probably the easiest to learn and use. OpenRC has a long tracking record and is production ready. Runit is also easy to use. S6 is very modular and powerful but needs a little more time and effort to learn. In terms of dependency handling, dinit and S6 are better. Artix has a wiki page for each init system. The Artix dev has done a great job putting together what you would need to know before you can actually use the system. In each wiki section, external links are also included. You can navigate through to find information in case you need to learn more.

Depends on what you want to achieve here, if your focus is on Cyber Sec/pentesting, any init system (including systemd) can bring your system up. No need to worry about how and how long they bring your system up.


The issue is, I am ever so slightly bothered by Systemd. And this isn't just about cyber sec; though the system will be used primarily for this, its primary purpose is a daily driver on my main Desktop, not a VM or anything redundant. It's going to be long-term, so I want it to be both robust and some degree of blazing fast.

It is the reason why I consider Systemd though; the fact it is a simple "just works" solution for the various apps I'll be getting. It's intimidating for good reason. But the intimidation mostly lies in that one aspect alone; knowing how to code a service for something that uses Systemd.

Only reason I consider s6 is because well, it seems more modular and powerful. OpenRC is weirder and more convoluted by the sounds. Runit was nice to test, but its last update was years ago so it looks archaic. s6, being nicest looking, puts me in the pickle of not knowing how to use it. The insight you reinforce is appreciated, though; I'll continue considering the alternatives.

Thanks for the quick feedback, really appreciated. How have you handled this switch to different init systems yourself, what resources have you used?
 

Re: Debating Artix + s6/runit. Convince me!

Reply #4
If security is an issue then not using systemd is a good start. Runit and OpenRC are well established and reliable, most services already exist in the repos (likewise for other inits) so it's unlikely you will need to write your own services unless you find something really obscure or write your own apps. For OpenRC the man pages include a good starter guide:
https://github.com/OpenRC/openrc/blob/master/man/openrc-run.8
You can probably find a more readable example online than the raw man page code but I linked that as I'm sure it's the latest version - if you copy paste it somewhere you can read it using man -l if you want. Most of the fields in the example won't be needed either, it's giving a run down of possible values and the kind of shell logic you can include, if you look at some examples of init scripts they are mostly just a few lines long.

That. That right there, is exactly what I'd love to find for s6. Do you have a link for a man page that could break things down exactly like that for it?

For that matter, do you have one for Runit? That's my next closest pick if it isn't s6, because I loved its simplicity and it'd be my stepping stone while waiting for s6 to evolve; s6's docs even describe it as a close cousin.

I definitely need to have learning resources for coding my own scripts. I can guarantee you due to the unfortunate focus of my learning, I will definitely be running things which aren't in Artix's repo, so learning resources like these are excellent. Thanks for the useful pointer, I'll definitely be using this to test out OpenRC soon. You've saved me a bunch of disoriented man-scrawling

Re: Debating Artix + s6/runit. Convince me!

Reply #5
Spin up some VM's and try them all. Choose an daemon which has no service file pre-existing in any of them and then write one for each of them. See you which you grok the easiest, are most comfortable with.

There's no better way to get a proper feel of which is the best for your needs.

But if you really want to be a 'pen-tester' I think it would help to understand the most popular Linux server init inside out . That would be systemd. So if you only half understand systemd then stick with that for now or as well.

Re: Debating Artix + s6/runit. Convince me!

Reply #6
I don't know about s6 myself, although I expect others here will be able to help you with that. For Runit the main website offers a good overall guide:
http://smarden.org/runit/index.html
And there is a large collection of existing run scripts posted on there too, from which you can usually find an example that does what you want and can be modified to run your service:
http://smarden.org/runit/runscripts.html
Runit is intentionally not changed, it's finished, like the Mona Lisa, no moustache or earrings required.  :D
What you find with init's is that the implementations in different distros can vary a lot - so what works in one may not work in another. So you can't really do much more than some preparatory research until you install something and start trying stuff to see what works and how it's all set up in reality. It's a lot easier to get the answers you want from the inside than trying to understand from the outside, because you can ls the relevant directories, pacman -Ql the package to see where the files are, look at the files and their permissions and owners in situ, and have all the man pages installed for easy reference.

It's not that difficult really, before systemd obviously no-one used it, even in the beginner distros.

Re: Debating Artix + s6/runit. Convince me!

Reply #7
I don't know about s6 myself, although I expect others here will be able to help you with that. For Runit the main website offers a good overall guide:
http://smarden.org/runit/index.html
And there is a large collection of existing run scripts posted on there too, from which you can usually find an example that does what you want and can be modified to run your service:
http://smarden.org/runit/runscripts.html
Runit is intentionally not changed, it's finished, like the Mona Lisa, no moustache or earrings required.  :D
What you find with init's is that the implementations in different distros can vary a lot - so what works in one may not work in another. So you can't really do much more than some preparatory research until you install something and start trying stuff to see what works and how it's all set up in reality. It's a lot easier to get the answers you want from the inside than trying to understand from the outside, because you can ls the relevant directories, pacman -Ql the package to see where the files are, look at the files and their permissions and owners in situ, and have all the man pages installed for easy reference.

It's not that difficult really, before systemd obviously no-one used it, even in the beginner distros.

Right, I've freshly made my first script in Runit, porting over that aformentioned Neo4j of mine for Bloodhound without breaking too much of a sweat and it's working really nicely. Robust, simple, quick and disabling running on startup was as easy as touching a file too.

That's on my test VM. I'm really still waiting for some divine intervention from an s6 user, because while that did feel nice and I understand what you're saying about runit's completion, I'm really wanting that lick of extra control that s6 gives, besides the other bonus goodies. With modernity, tends to come changes someone 14 years ago might've wanted to implement but never did. I'm not saying make an init system every few years, but I'm definitely saying maybe this one's doing something right.

If some experimentation in yet another VM doesn't do me justice, I think I'll be sticking to runit and getting the ball rolling with this one.

What's the init system you're using, if you don't mind sharing? And why? While it may seem counter-intuitive, I am looking for some personal opinions and experiences too, besides the excellent help.

 

Re: Debating Artix + s6/runit. Convince me!

Reply #8
I use OpenRC, it was the original init here, it's only relatively recently in the history of Artix additional inits were added to the official repos. It works well and remains reliable after updates, and I'm familiar with it so I haven't felt any need to use anything else recently! It has a built in boot logging facility which can be useful too. It's a development of the Debian implementation of sysvinit, which was widely used before systemd, and can still be found in Devuan.
 I expect if you were to start using S6 and had specific questions then you would probably get good answers in the S6 section of the forum. All the inits here seem to work, although some are (slightly) more stable than others, but any problems usually get fixed quickly after being reported - my use case is most likely not the same as yours, choose what best fits your needs!  ;D