Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) 20 November 2021, 11:52:41 Hi,I was able to enable and start (runit sv up,...) some services, but one in particular is stubborn. Status is ENABLED but STATE is DOWN. The service that doesn't work with runit is stubby. Is this a bug? It gets timed out when I want to start it.So (as sudo):$ pacman -S stubby stubby-runit$ ln -s /etc/runit/sv/stubby /run/runit/service/$ sv up /run/runit/service/stubbyAnd I get:$ sv status stubbydown: stubby: 0s, normally up, want upSo I did the following:$ pacman -S rsmand rechecked the status:$ rsm status stubby SERVICE STATE ENABLED PID COMMAND TIME X stubby down true --- --- 0 secondsStill DOWN. So I did this:$ rsm start stubbyand... got this:[rsm] Running sv command (SVDIR=/run/runit/service/ sv start stubby):timeout: down: stubby: 0s, normally up, want up[rsm] [sv start stubby], exit code: 1Still the service is DOWN. Enabled but not working. (Works with systemd). I have spent way to much time to configure Artix to just give up now. Any idea? Is this a bug?P.S.: $ man rsm gives nothing (doesn't exist). No explanations for exit codes. Quote Selected Last Edit: 20 November 2021, 12:01:17 by Runner
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #1 – 20 November 2021, 12:55:42 stubby is run using user 'stubby' by the service.Did you set the listen port to one above 1024 in /etc/stubby/stubby.yml ?That is required to have a non-privileged user to be allowed to bind to the address.artist Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #2 – 20 November 2021, 15:10:30 alQuote from: Artist – on 20 November 2021, 12:55:42stubby is run using user 'stubby' by the service.Did you set the listen port to one above 1024 in /etc/stubby/stubby.yml ?That is required to have a non-privileged user to be allowed to bind to the address.artistI don't know what are you talking about. Other services are OK with runit, stubby doesn't work with runit. Stubby works with systemd only. Can you fix it? Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #3 – 20 November 2021, 15:37:12 Hi,I was able to enable and start (runit sv up,...) some services, but one in particular is stubborn. Status is ENABLED but STATE is DOWN. The service that doesn't work with runit is stubby. Is this a bug? It gets timed out when I want to start it.So [all done as sudo and su -] :$ pacman -S stubby stubby-runit$ ln -s /etc/runit/sv/stubby /run/runit/service/$ sv up /run/runit/service/stubbyAnd I get:$ sv status stubbydown: stubby: 0s, normally up, want upSo I did the following:$ pacman -S rsmand rechecked the status:$ rsm status stubby SERVICE STATE ENABLED PID COMMAND TIME X stubby down true --- --- 0 secondsStill DOWN. So I did this:$ rsm start stubbyand... got this:[rsm] Running sv command (SVDIR=/run/runit/service/ sv start stubby):timeout: down: stubby: 0s, normally up, want up[rsm] [sv start stubby], exit code: 1Still the service is DOWN. Enabled but not working. (Works with systemd). I have spent way to much time to configure Artix to just give up now. Any idea? Is this a bug?Expected result:1. Install stubby+stubby-runit2. Create symlinks3. Enable + start stubby (sv up or rsm start)4. All should work (just like $ systemctl start stubby && systemctl enable stubby), i.e. service should not only be ENABLED (current state in runit) but should also RUN (current status is DOWN). RUNIT SHOULD MANGE ALL SERVICES. This one (stubby) cannot be started. Runit can only enable it, but NOT start. Sytemd can both ENABLE and START Services. If runit cannot start services what kind of service manager is this then?[/b]P.S.: $ man rsm gives nothing (doesn't exist). No explanations for exit codes. I have no idea what those exit codes mean. Quote Selected Last Edit: 20 November 2021, 15:51:02 by Runner
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #4 – 20 November 2021, 15:56:40 Quote from: Runner – on 20 November 2021, 15:10:30alI don't know what are you talking about. Other services are OK with runit, stubby doesn't work with runit. Stubby works with systemd only. Can you fix it?First, a quote from the stubby man page:Quotestubby is in the early stages of development but is suitable for technical/advanced users.as with any service, you need to at least check what is the default configuration for the service, as suggested by Artist.Checking out /etc/runit/sv/stubby/run gives:Code: [Select]$ cat /etc/runit/sv/stubby/run#!/bin/shexec chpst -u stubby stubbyin other words, that service is run not as root user (there is no "sudo" user, sudo is a privilege escalating program, but that is something a "technical/advanced user" should know), but as ordinary user account "stubby" reserved for running stubby. You can check its existence by doingCode: [Select]$ grep stubby /etc/passwdMany services use this approach, as it is more secure. However, ordinary user accounts cannot normally bind ports below 1024. This is by design. So, you will need to configure stubby to use a port above 1024. Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #5 – 20 November 2021, 16:02:44 Please don't double post. There is already a post with the same topic:https://forum.artixlinux.org/index.php/topic,3302.msg21490/Edit: Merged. Quote Selected Last Edit: 20 November 2021, 16:08:08 by strajder
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #6 – 20 November 2021, 16:14:01 Quote from: strajder – on 20 November 2021, 16:02:44Please don't double post. There is already a post with the same topic:https://forum.artixlinux.org/index.php/topic,3302.msg21490/Edit: Merged.Demons are in Sytem above then runit deamon manager is below. This forums is confusing. Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #7 – 20 November 2021, 16:20:00 As strajder and Artist noticed, this is not an incompatibility, but the simple fact that ports under 1024 are root-only under Linux (and most BSDs, for that matter). The systemd service for stubby works because it uses systemd's hardcoded support for Linux capabilities so it can bind to ports <= 1024 despite not being root.For runit, you achieve a similar result by adding the cap_net_bind_service capability to the stubby binary:On a terminal:Code: [Select]sudo setcap cap_net_bind_service+eip /usr/bin/stubbyThen your service definition should work unchanged.The "correct" way would for it to accept a prebound socket on its standard input, so we could use runit's tcpsvd, or systemd's socket activation, to bind the socket as root then drop root after getting the connection. Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #8 – 20 November 2021, 16:21:44 Does stubby work if you start it by executing commands from /etc/runit/sv/stubby/run manually? Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #9 – 20 November 2021, 16:28:22 Quote from: Runner – on 20 November 2021, 15:37:12P.S.: $ man rsm gives nothing (doesn't exist). No explanations for exit codes. I have no idea what those exit codes mean.rsm is a Bash script. You can list its contents with less or open it up in any text editor.If you were not sure what type it is:Code: [Select]$ file $(which rsm)/usr/bin/rsm: Bourne-Again shell script, Unicode text, UTF-8 text executablelist:Code: [Select]$ less $(which rsm)Exit code printed in this case is the exit code from the sv program. (It can be seen on line 610, do_sv_cmd function.) Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #10 – 20 November 2021, 16:41:54 Quote from: strajder – on 20 November 2021, 16:02:44Please don't double post. There is already a post with the same topic:https://forum.artixlinux.org/index.php/topic,3302.msg21490/Edit: Merged.No.Port 53 and 853 are for DNS. Latter for DNS over TLS. This is how ALL provided DNSes have it configured. Systemd as service manger is capable of both ENABLING and STARTING services. It is a service manger. I download Artix with runit services manager and everything is broken. So lets list it:1. I have to install additional package with "-runit" on top of the normal "service name" package2. I have to create special confusing symlinks before I can start the service3. I have to read documentation because the symlink has to be in some confusing SUBFOLDER otherwise it will not work (really NOT KISS if one have to dig and dig the documentation to find it in the wiki text)4. Then I have to enable the service and it will be enabled.5. Then I have to sart the service but the service manager cannot do it (unlike systemd in Fedora and Debian). I am left with non working service.6. I am faced with unfriendly forum and excuses.As a user, I See the following: SYSTEM D RUNIT 1. pacman -S stubby 1. pacman -S stubby2. systemctl enable stubby && systemctl start stubby 2. pacman -S stubby-runit4. DONE and ready to use service! 3. ln -s /etc/runit/sv/stubby /run/runit/service/ 4. sv up /run/runit/service/stubby 5. still cannot use the service- its broken 6. pacman -S rsm 7. rsm start stubby 8. still cannot use the service. broken. 9. man rsm ==> no such thingNobody is forcing you to use OUR distro. Go home and make your OWN. Thank you. Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #11 – 20 November 2021, 16:44:52 Quote from: Artist – on 20 November 2021, 12:55:42stubby is run using user 'stubby' by the service.Did you set the listen port to one above 1024 in /etc/stubby/stubby.yml ?That is required to have a non-privileged user to be allowed to bind to the address.artistI believe the service definition for stubby can be amended to use setpriv from util-linux instead of chpst, or the stubby package itself be changed so the CAP_NET_BIND_SERVICE is pre-added to the file. This would allow it to be launched without users having to first edit the configuration file.setpriv is a also a chainloader, i. e. runit can still monitor services launched from setpriv just fine like it can manage processes launched from chpst.(and as OP notices, changing the port is not viable, as the standard DNS/DoH ports are below 1024). Quote Selected Last Edit: 20 November 2021, 16:49:53 by capezotte
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #12 – 20 November 2021, 17:06:41 Quote from: Runner – on 20 November 2021, 16:41:54Nobody is forcing you to use OUR distro. Go home and make your OWN. Thank you.Are you talking to yourself? stubby is not something for beginners, as already explained.For me (and others who use Artix and other non-systemd distros) the wrongs of systemd far outweigh any perceived benefits. You can check out the links in my signature for more details:https://suckless.org/sucks/systemdhttps://nosystemd.org/You are, of course, free to use whatever system you feel like (even multiple systems!). But please don't preach systemd on a forum of a non-systemd distro. That is called trolling. Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #13 – 20 November 2021, 17:14:27 Quote from: strajder – on 20 November 2021, 17:06:41Are you talking to yourself? stubby is not something for beginners, as already explained.For me (and others who use Artix and other non-systemd distros) the wrongs of systemd far outweigh any perceived benefits. You can check out the links in my signature for more details:https://suckless.org/sucks/systemdhttps://nosystemd.org/You are, of course, free to use whatever system you feel like (even multiple systems!). But please don't preach systemd on a forum of a non-systemd distro. That is called trolling.Not a solution. Not a KISS approach. The answer: its too complicated, don't use it doesn't satisfy anyone. Not to mention the ports. Oh wow! Quote Selected
Re: Is This A Runit Bug (Enabled but Cannot Start- Unlike Others) Reply #14 – 20 November 2021, 17:21:48 @Runner, does setcap make it possible to start the service under runit? Quote Selected