Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: ugluk on 15 April 2025, 00:58:06

Title: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: ugluk on 15 April 2025, 00:58:06
1. the sound volume in KDE is not saved on reboot and I need to unmute every time I boot into KDE, otherwise the sound works, I am using pulse. How to fix it?
2. I need to run shutdown as sudo shutdown, I'd much prefer just to type shutdown without sudo (do I need to set SUID?)
3. can cups run like an inetd service on demand? I'd like to rid myself of this daemon process. Can the same be done with openssh server?
4. I already uninstalled and disabled metalog, can I disable/uninstall other useless services?
5. How to run ntpdate whenever a network connection comes up? If you managed to cajole KDE to do the same, please share?

Solved the sound issue: either trizen -S alsa-utils-runit or add /usr/bin/alsactl restore to rc.local
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: capezotte on 16 April 2025, 02:34:51
2. I need to run shutdown as sudo shutdown, I'd much prefer just to type shutdown without sudo (do I need to set SUID?)
Use loginctl poweroff. You can alias it if you don't want to type loginctl every time.

BTW, SUID wouldn't work anyway because runit shutdown is a shell script.

Quote
3. can cups run like an inetd service on demand? I'd like to rid myself of this daemon process. Can the same be done with openssh server?

See man 8 cupsd and man 8 sshd. TLDR; no and yes respectively.

Quote
5. How to run ntpdate whenever a network connection comes up?

Hook it up with dhcpcd, connman, NetworkManager or whatever you're using to set up network connections. Or make a runit service that tries and tries again until it succeeds, then exec's pause /shrug
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: matrixphil on 17 April 2025, 12:48:47
I appreciate the workaround for the shutdown command; using loginctl poweroff is a great suggestion. Also good to know about the CUPS and OpenSSH service management; I’ll check the man pages for more details.

As for running ntpdate on network connection up, I like the idea of integrating it with the network manager. I’ll look into creating a runit service that handles that as well.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: ugluk on 18 April 2025, 19:40:30
Surprisingly, setting SUID did work both on shutdown and reboot.

Can someone suggest what inetd implementation I should use on artix? Is there anything in the docs about how to do this? Under plain arch, it is done with systemd scripts, but that does not apply here.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: gripped on 19 April 2025, 01:19:56
Surprisingly, setting SUID did work both on shutdown and reboot.

Can someone suggest what inetd implementation I should use on artix? Is there anything in the docs about how to do this? Under plain arch, it is done with systemd scripts, but that does not apply here.
I don't think you can easily? But I'm not an expert in all inits and not even in the one I use.
inetd was abandoned because it's not the greatest idea (imho but lots of people seem to agree).
Surely it's better to run the server services you chose when you chose rather than when something wants to connect to you ?
What is the benefit of inetd to you ?
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: lq on 19 April 2025, 04:18:43
Can someone suggest what inetd implementation I should use on artix? Is there anything in the docs about how to do this?

https://en.wikipedia.org/wiki/Xinetd
https://github.com/openSUSE/xinetd

Code: [Select]
pacman -S xinetd xinetd-runit

Code: [Select]
man xinetd
man xinetd.conf
man xconv.pl
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: linux4ever on 19 April 2025, 06:21:09
1. the sound volume in KDE is not saved on reboot and I need to unmute every time I boot into KDE, otherwise the sound works, I am using pulse. How to fix it?
Solved the sound issue: either trizen -S alsa-utils-runit or add /usr/bin/alsactl restore to rc.local
I am having the same issue with my sound in openbox window manager and pulse audio.  Would you be so kind as to "walk" me through adding /usr/bin/alsactl restore to rc.local?  I have found both files on my install but do not know how to accomplish the task.
Thanks!
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: linux4ever on 19 April 2025, 06:25:04
Screenshot of the above files mentioned.

Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: ugluk on 19 April 2025, 14:39:40
yeah, loool, just:

vi /etc/rc.local

#!/bin/sh

# /etc/rc.local -- rc.local for Artix Linux
#
# Enter your custom commands here.
/usr/bin/alsactl restore

Of course, you need to run "alsactl store" beforehand (when the audio is working), or you have nothing to restore. So, you need to unmute the audio somehow beforehand, for example, using alsamixer. The alternative, "pacman -S alsa-utils-runit" is easier.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: ugluk on 19 April 2025, 14:45:00
Don't forget to take a look at "ucspi-tcp" when looking for an inetd alternative, it seems much more in the spirit of artix to me than xinetd.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: capezotte on 19 April 2025, 15:32:28
1. the sound volume in KDE is not saved on reboot and I need to unmute every time I boot into KDE, otherwise the sound works, I am using pulse. How to fix it?
Solved the sound issue: either trizen -S alsa-utils-runit or add /usr/bin/alsactl restore to rc.local
I am having the same issue with my sound in openbox window manager and pulse audio.  Would you be so kind as to "walk" me through adding /usr/bin/alsactl restore to rc.local?  I have found both files on my install but do not know how to accomplish the task.
Thanks!

A better way is to install alsa-utils-$your_init and enable the service that comes with it (usually named "alsa").

Less manual intervetion, plus alsactl store also gets run on install and shutdown so no need to run it again whenever you tweak the audio settings.

Don't forget to take a look at "ucspi-tcp" when looking for an inetd alternative, it seems much more in the spirit of artix to me than xinetd.

Artix packages s6-networking, which is basically s6's take on that concept. Same command line parameters, just replace tcpserver on the run scripts with s6-tcpserver and you're set.

Not only you won't need AUR, it's maintained (including proper IPv6 support) and tweaks a few defaults to make it harder for DoS attacks to work.

Using the rest of s6 is not needed, it'll happily run from runit, openrc or whatever.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: gripped on 19 April 2025, 19:26:33
I stand corrected. I still think it's a dubious idea though.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: linux4ever on 19 April 2025, 23:03:35

"A better way is to install alsa-utils-$your_init and enable the service that comes with it (usually named "alsa").

Less manual intervetion, plus alsactl store also gets run on install and shutdown so no need to run it again whenever you tweak the audio settings."


That didnt work and actually borked my audio system so bad to the point I could not fix it and had to re-install my Artix install.   >:(
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: capezotte on 20 April 2025, 00:40:50
All I can say is, it's an official package, and it worked for me (s6), and for the original poster of this thread (runit).

What is your init system, how exactly was your audio borked, and what did you do to try to fix it? If this isn't a coincidence, it's a bug that must be fixed.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: linux4ever on 20 April 2025, 20:49:49
openrc, sound server not connecting, removed files I was told to install and rebooted.  Was not able to catch screenshots of the errors/isses when they occured.  Still no joy so I reinstalled and started back fresh.  I will deal with the muted issue each time I log in/boot into Artix.  No biggie.  Thanks anyway.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: ugluk on 21 April 2025, 21:05:28
 @linux4ever You need to seriously reflect upon what you are doing wrong. Save the alsa state AFTER you unmute the audio by doing

alsactl store

then reboot and see if:

alsactl restore

unmutes the audio. If it does, then add the line to rc.local.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: capezotte on 22 April 2025, 00:18:38
Apparently, rc.local worked for them, but not alsa-utils-openrc. Not that it should matter, since installing and enabling the alsa service should ultimately do the same thing, and there aren't any obvious issues in the openrc script (despite it being significantly bigger than its matches in other inits).

The error being "sound server" related makes me think installing alsa-utils-openrc was just a coincidence and they somehow broke PulseAudio/Pipewire instead.

Surprisingly, setting SUID did work both on shutdown and reboot.

I took a look into it and found out halt is a C program (poweroff and reboot being links to it), and shutdown is a shell script that calls into it.

So setting SUID on reboot (and by proxy, on halt and poweroff) actually works, and as long as you don't use any features that rely on the shutdown script itself being root (like delayed shutdown, forcing fsck, etc.), the fact that SUID doesn't apply to scripts is irrelevant (I guess you can remove SUID from shutdown, and it won't make a difference).

Surely it's better to run the server services you chose when you chose rather than when something wants to connect to you ?

Well, there's faster boot times, lower idle RAM usage, and it takes off the burden of having to choose when to start in the first place.

Also, AFAIK, inetd got abandoned because systemd ate it; most services on systemd distros use "socket activation" (systemd's rebrand of inetd's features), to the point (for example) Arch patches GPG to keep it despite the feature having been deprecated and explicitly not supported upstream.

I'm mostly playing devil's advocate here, because you can save RAM with none of the reliability trade-offs by just using swap space, and inetd services often lead to increased startup time and RAM usage per instance if they're not refactored in ways that make then more awkward to use (like how most programs made for ucspi-tcp use a binary config file so that each instance doesn't spend time and RAM analyzing a text config).
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: lq on 24 April 2025, 04:31:18
I stand corrected. I still think it's a dubious idea though.

It was asked about the implementation and not whether it makes sense to use inetd, so I can't really understand your excitement.


Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: gripped on 24 April 2025, 13:52:12
so I can't really understand your excitement.
Add it to the long list then.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: TheExplorer on 07 May 2025, 09:20:54
Damn, I've been struggling for a couple of days already with pulseaudio on a fresh installation. It mutes on every damn reboot. Finally found out that I needed alsa-utils-runit package. Thanks, guys.
Title: Re: [SOLVED] Artix/runit: muted sound, shutdown/reboot, cups
Post by: Piku on 26 May 2025, 15:40:22
@ugluk thanks, your solution worked perfectly for mute audio on every reboot. Can you also help with bluetooth turned on,num lock off and brightness at lowest on booting? I am using cinnamon with dinit.
Edit- I could not figure how to remember state of these things on each startup, but installing tcl,numlockx and brightnessctl, then adding their commands in rc.local worked for me. Thanks @ugluk for the idea though.