The officially official Devuan Forum!

You are not logged in.

#1 Re: Hardware & System Configuration » Excalibur, runit's supervision tree inherits tty1, misbehavior » 2024-10-25 15:33:22

Hi Alverstone,

I redirected runsvdir output to /dev/tty10 on my system and  tested  <sysrq>+K on tty1 and it brings down the system;
tested again, and it's actually the

exec <>

that does the trick and shields runsvdir from <sysrq>+K

I would like to address them all, and keep a log or runsvdir if possible..

I should have been more precise, apologise if this wasted your time in search of a solution with a proper log:
what I mean is that it's preferable to not discard completely the runsvdir output by default; it doesn't have to be necessary a proper log file.

since output to tty and exec <> does the trick I think I prefer that to proper fifo.

Issue with the fifo is what happens if the buffer is full and there is nothing reading on the other side, I'm not sure if that can affect runsvdir in a bad way, that would be a problem.
What I fear (more than the race between lines written and runsvdir-log startup) is that a user can disable the runsvdir-log service because he doesn't care and then, due to some service malfunction later, the buffer slowly fills up.
Runsvdir output 1 line per second for each non functional service (example run not executable or not found); how many line it takes before the fifo buffer is full?

On the other hand is hard to predict if a ttyN is available in a system; only thing that is granted to be there is /dev/console (reason why runit outputs there, I think) but /dev/console is connected with tty1, so we are at the starting point..

I agree with the logic you proposed for stage 2 but I prefer something more simple; your proposed code could be fine if I roll runit specific bootscripts but for now I prefer to keep stage 2 more simple. I'm thinking of an hardcoded list of  /dev/* with a fallback on /dev/console;
I think standard system (desktop, laptop, server) have plenty of tty; less sure about embedded hardware (raspberry, arduino or even more essential hardware); there is also the container case to cover.

Something like (recycling you code, simplified)

for out in tty12 ttyS1 tty1 console; do
  if [ -c /dev/"$out" ] ; then
     PIPE="/dev/$out"; break
  fi
done
exec <>"$PIPE" >"$PIPE" 2>"$PIPE"
exec env - PATH="$PATH" runsvdir -P "${SVDIR}"

your code is certainly more configurable from user point of view,
but unfortunately I fear is also more fragile if the user is not aware of the fifo.
let me know if you  see shortcomings or you have more thoughts on this; I intend to
add a fix for this in the next runit upload to unstable.

Thanks for your ideas!
Lorenzo

#2 Re: Hardware & System Configuration » runit: exim4 is broken » 2024-10-21 21:26:02

Hi,
regardless how bad it's exim4, either it need to be fixed or dropped from runit-services package.
I'll have a look, thanks for reporting

Lorenzo

#3 Re: Hardware & System Configuration » Excalibur, runit's supervision tree inherits tty1, misbehavior » 2024-10-21 21:22:47

Hi!

<sysrq>+K on tty1 brings the system down

One solution I am aware of is
exec </dev/null >/dev/null 2>/dev/null

but this discards all output from runsvdir right? Or are you able to get it in some other way?

anyway, clutter tty1 is a known issue, <sysrq>+K is new to me. And there is also this other issue
https://github.com/void-linux/runit/issues/14
reported at Void.

I would like to address them all, and keep a log or runsvdir if possible..

Could you test the following in stage 2

PIPE=/run/runit/runsvdirpipe
mkfifo "$PIPE"
exec <> "$PIPE"

exec env - PATH=$PATH  runsvdir -P "${SVDIR}" >"$PIPE" 2>"$PIPE"

note that the log arg for runsvdir (the dots) is removed.

and a log of runsvdir could be catched with a simple service like (run file)

#!/bin/sh

NAME="runsvdir-log"
LOG=/run/runit/runsvdir-log
test -d "$LOG" || mkdir "$LOG" && chown -R _runit-log:adm "$LOG"

exec 2>&1

exec < /run/runit/runsvdirpipe
echo "Starting runsvdir-log"

exec chpst -u _runit-log svlogd -tt "$LOG"

I tested quickly and it seems to do the job, please let me know if it works for you

Lorenzo

#4 Re: Hardware & System Configuration » Daedalus 5.01 desktop, Runit version, logrotate error spotted » 2024-10-06 17:54:25

Hi!

do you have rsyslog and anacron or cron installed in your runit system?

I believe this is the result of
(some cronjobs are skipped due to invoke-rc.d actions not effective on some runscripts)
https://bugs.debian.org/cgi-bin/bugrepo … ug=1071395
and
(rsyslogd maintainer sabotaging alternative inits, affecting runit-services)
https://bugs.debian.org/cgi-bin/bugrepo … ug=1079268

fix will be available in next stable release (already have commits in git, still need to do some testing though)
Apologies for the inconvenient, I didn't catch this before current stable was released hmm

Lorenzo

#5 Re: Other Issues » OpenSSH fails to start with the latest update in Devuan 6 Excalibur » 2024-08-21 20:59:30

Hi!

Is this is a side effects of the fix for #1038789 ? (not sure)
https://bugs.debian.org/cgi-bin/bugrepo … %231038789

Where should I file a ticket — in bugs.devuan.org or in bugs.debian.org?

the openrc package is not forked in Devuan, so please report directly to Debian!

Cheers,
Lorenzo

#6 Re: Other Issues » How do I stop apt deleting stuff from /etc/service? » 2024-07-05 21:30:39

Hi,

I'm running Devuan Excalibur with runit as the init, and apt keeps deleting /etc/service/elogind (normally a symlink to /etc/sv/elogind). This results in runit killing elogind, which terminates the desktop session.

this is likely a runit trigger combined with a bug in runit-services (elogind bin recently changed path); you can check this by looking inside the elòogind service directory, there should be a .meta directory with inside a 'bin' file and the path inside the file is wrong; because of this, the trigger thinks that elogind is not installed and disable the service.

if you have the elogind service in /etc/sv try do (as root)

# echo /usr/libexec/elogind > /etc/sv/elogind/.meta/bin
# /lib/runit/trigger_sv setup

the symlink in /etc/service should persist

if you don't have the service in /etc/sv/ then you should update the runit-services package,
in the latest version the bug is fixed

There is a non-functional /etc/init.d/elogind which I have replaced with a symlink to /bin/sv. This also keeps getting reverted.

this one is not runit fault, dpkg doesn't consider symlinks as conffile, so they are not preserved and can be overwritten by packages; anyway,
I know what's the symlink for (restarting the service on upgrade) and the runit trigger provides the same functionality, so I suggest using the trigger.

the trigger is not documented anywhere, but basically it uses a 'bin' file inside a .meta directory that should contain the path that is exec'd in the runscript, and does the following:

* if the path in bin file can't be found on the system, the service is considered uninstalled and so the runit service is disabled/stopped

* if the path in the bin file can be found in the system and the service is disabled, the runit service i enabled/started
   (there are exceptions, like when the local admin marked the service as disabled)

* it also takes care of restarting the service on upgrade

to completely disable the trigger on one service that is in /etc/sv/ you can empty/ or remove the bin file

Hope this helps,
Lorenzo

#7 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-05-04 09:17:34

From Lorenzo's bug report:

    Note that recently debhelper started to chmod -x initscripts when a package is
    removed but not purged, (...)

That sounds terrible!

Why? in any case the sysv script is not usable if the binary is not installed. The chmod - x is done for heuristics, for example to be able to tell if the binary is installed and avoid to unecessary call the script if it's not (I'm talking about automatic start/restart that happens in maintainers script during package upgrades)

Is the consequence, that any sysv initscript needs to be updated to fix this behavior?
(Or: If you have such a "helper" you don't need enemies.)

Not really: the script is automatically chmod +x as soon as you reinstall the package, you don't need to worry about this.  Other tools around initscript (invoke-rc.d, runit's /lib/runit/run_sysv_scripts) were changed to cope with non executable initscripts, openrc was just lagging behind.
Note that debhelper is used at build time to help pkg maintainers to automate the build process, it affects build-time, it doesn't affects runtime.

Lorenzo

#8 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-05-01 21:34:18

A file that is not executable on /etc/init.d/ breaks openrc installation for some reason, needs to make executable first or move to another directory

Please, next time, report bug like this! Nobody reports = nobody fixes.
It's now fixed in unstable/openrc 0.54-2
https://bugs.debian.org/cgi-bin/bugrepo … ug=1070167

#9 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-04-30 21:45:15

it looks like there is a problem with openrc postinstall script, likely a bug. As already mentioned, I know very few about openrc so I don't have an explanation. I suggest you open a bug report on openrc package linking this page

Lorenzo

#10 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-04-28 23:24:34

Thanks, reinstall only openrc? Why you mentioned +sysvinit-core?

Originally openrc used to run on top of sysvinit, so you need sysvinit-core + openrc;
recently openrc got it's own init, so it can run without sysvinit.
I'm not sure what the openrc deb package does, if you install openrc without sysvinit-core
just make sure that /sbin/init points to somewhere that make sense for openrc, like
maybe

/usr/sbin/openrc-init

I never used openrc so I'm more or less guessing the above.

#11 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-04-25 23:20:10

it seems to have worked smile But i not feeling any difference, only boot log looks another.
its was easy.

did you installed also runit-services package?

And to move back i must uninstall runit-init and make dpkg-reconfigure openrc or reinstall openrc?

I don't think dpkg-reconfigure has any use here; reinstall openrc + sysvinit-core should do it.
Then, to reboot from runit into openrc call

/lib/runit/runit-init 6

#12 Re: Installation » [SOLVED] Daedalus. Can i switch from openrc to runit without reinstall os? » 2024-04-11 20:51:20

Hi,

If it possible, how do this?

try the following

apt-get install runit-init

and then reboot the system

reboot

if plain 'reboot' doesn't work you may have to call
/usr/sbin/openrc-shutdown with appropriate options to reboot into runit

I tested sysv --> runit and going back to sysv, never tested from
openrc but it should work.

Best,
Lorenzo

#13 Re: Installation » Upgrading to Daedalus running runit-init » 2023-12-18 13:58:33

Maybe that should be 'chown -R "$USER:$GROUP" "$LOG"' to sort out the log files themselves, as well as the directory?

it was like that (chown -R) but the recursive option was removed due to symlink attacks [1] risk. But anyway I think the underlying issue is that I can't force a change in the log runscript (it's a conffile under /etc/) so there will always be a chance of a mismatch.
I'll drop an entry as NEWS file for runit to warn users.

Lorenzo
[1] For example https://github.com/OpenRC/opentmpfiles/issues/4

#14 Re: Installation » Upgrading to Daedalus running runit-init » 2023-12-14 19:18:09

Hi Geoff,

in /var/log/runit current and lock were both owned by "_runit-log adm" in the subdirectories acpid/ and ssh/
This was probably some historic set up error, but :-

cd /var/log/runit
chown runit-log:runit-log acpid/current
chown runit-log:runit-log acpid/lock
chown runit-log:runit-log ssh/current
chown runit-log:runit-log ssh/lock

soon had that fixed and after the next reboot the runsvdir command line contains the expected, clean line of dots.

Actually, 'runit-log' is being dropped and the '_runit-log' user is the right one. According to Debian policy users created by
packages should begin with _ to avoid confusion with real (uman) users. I thought I got this right but evidently I've missed
something, sorry sad
I recommend to update the log/run script of acpid and ssh with the one that is currently shipped (instead of changing permission
of current/lock), for example

cat /etc/sv/ssh/log/run

#!/bin/sh
chown _runit-log:adm '/var/log/runit/ssh'
chmod 750 '/var/log/runit/ssh'
exec chpst -u _runit-log svlogd -tt '/var/log/runit/ssh'

and then do

sv e ssh

to fix the error

#15 Re: Installation » [SOLVED] service ssh not running » 2023-10-05 21:49:20

Hi Fabien,

Using service ssh <whatever> does not do anything on daedalus.

There is no support for runit in the service wrapper, but what you are reporting
only happens if
* you have runit installed
* a runit definition for the service exists for example /etc/sv/ssh
* the service is enabled with runit ( /etc/service/ssh link exist )
otherwise the service wrapper should work

My workaround was doing touch /etc/runit/lsb.runit.sysv .

I don't recommend this unless you fully understand what it does: it will run the sysv script even if you have an active instance of the same service already managed with runit; possible side effect are:
- crash of the runit instance
- you get two instance running (only one is supervised by runit)
- the reported status of the service may be inconsistent with the one you get with 'sv status'
it also can break the upgrade of few packages - I think it was mariadb ..

The real fix would be to add runit support to the service wrapper, hopefully will happen in this cycle; for the time being I recommend to use the sv command to control services that are managed by runit.

Lorenzo

#16 Re: Hardware & System Configuration » Default dhcp client floods my syslog » 2023-09-18 14:35:30

This is a bug in dhclient script shipped with runit-services package

https://bugs.debian.org/cgi-bin/bugrepo … ug=1033542

is fixed in testing and unstable, but stable will have to wait untill the next point release hmm

To fix it, both methods suggested by Geoff will work

The version started from runit has now been removed

update-service --remove /etc/sv/dhclient

and the VM (under Xen) where I am testing it, still boots ok with just the one copy of dhclient.

Interestingly, the runit copy was earlier complaining even more about not being able to find eth1. I then spotted that the new runit setup for dhclient had a config file in conf/interfaces which contained

INTERFACES=eth1

Changing this to eth0 soon solved that.

basically disable the service or replace 'eth1' in /etc/sv/dhclient/conf/interfaces
with an interface that exists in your system (look at the output of ifconfig)

The commit that fix it is here
https://salsa.debian.org/Lorenzo.ru.g-g … e19d826ded

Said that, I see that this service is annoying a lot of people for several reason, I wonder if (for the future) it will be better to ship the dhclient service as disabled-by-default: opinions are welcome

Regards,
Lorenzo

#17 Re: Other Issues » runit-services: new package available ! » 2023-06-30 19:23:02

Hi,

As a suggestion, you may consider using

sv check dbus || exit <some_value>

instead of

sv start dbus || true

(sv start)  is equal to (sv up + sv check), so the subtle difference is that I'm forcing the wanted status to be 'up' before the check;
as for true vs exit <some_value> I'm using the latter for hard dependency and true for soft dependency. Of course I may have wrongly set a dependency as soft instead of hard..
Do you have a script that doesn't work for your use case? If yes please report it and I'll have a look again.

#18 Re: Installation » [SOLVED] Switching between init choices » 2023-06-27 19:33:55

It worked on my desktop, too.  The only problem is that I could not reboot afterwards and had to power cycle the machine.

Next time do the following:

1. install sysvinit-core (it will remove runit-init package), but don't remove the runit package (yet);
2. tell runit to reboot the system with

# /lib/runit/runit-init 6

(see man runit-init for details)

After you reboot into sysvinit you can safely remove the runit package too

Lorenzo

#19 Re: Hardware & System Configuration » [SOLVED] rsyslog, logrotate » 2023-06-21 11:32:03

Edit: I am using runit as init in case this matters.

yes it does: are you running rsyslog with a runit service or as sysv script?

If you use a runit service you may have to add a cronjob with
(assuming that your service is called 'rsyslogd')

sv hup rsyslogd

if you are using the old sysvscript, have a look at /usr/lib/rsyslog/rsyslog-rotate;
recent version of the Debian package are using code that is a noop on non-systemd systems.
if that's the case, you need to create a cron job with

if [ -x /etc/init.d/rsyslog ]; then
    invoke-rc.d rsyslog rotate > /dev/null
fi

I'm not sure if Devuan has it's own version of rsyslog package, but still worth a check

#20 Re: Hardware & System Configuration » [SOLVED][Daedalus] Laptop lid open/close issue » 2023-05-13 10:37:45

I ran all my tests also without xfce4-power-setting enabled, but I still got the striped screen

what about replacing xfce4-screensaver package with xscreensaver?

yes I am exactly him...

Ha! I remember you! I used to be on that forum too (Ombra) years ago, nice to meet you again smile

#21 Re: Hardware & System Configuration » [SOLVED][Daedalus] Laptop lid open/close issue » 2023-05-12 23:58:54

Hi,

[ sorry I don't have the solution, just some things to check ]

are you using the runit-services package, or you have your own set of runscripts or none of the two? is lightdm a runit service or is run as sysvinit script by the sysv emulation at startup?

If I g too the TTYs and I try to restart the lightdm(runit) through sudo service lightdm stop/start

if you have lightdm as runit service the right command is

sv stop/start lightdm

or (for a full restart)

sv e lightdm

I tested Debian on the same hardware, I bought to my daughter the same laptop and install Debian instead of

just to be sure, Debian + systemd?

Anyway, my suggestion is to try to replace some xfce component with some other program and see if it works:

It may be the screensaver/locker that doesn't work, for example it freezes while it should draw the window for user/passwd to unlock the screen: what are you using as screensaver/locker?
I'm using xscreensaver and it works fine with elogind (despite launching a xscreensaver-systemd), but I'm using Debian+ lxqt + runit and I'm not sure if it's lxqt-powermanagment that does the magic

another thing is to try to stop completely/kill the xfce4-power-manager daemon before closing the lid and see if elogind can handle the job;  try with elogind + xscreensaver, not sure if xfce-screensaver will work without the xfce4-power-manager

Lorenzo

OT: by any chance are you the same Danielsan of the "Debianizzati" italian forum?

#22 Re: Documentation » How to start libvirt-daemon with runit » 2023-05-10 11:16:55

The package is installed. So I would assume to find the init scripts under /etc/sv. Nothing there.

that would be the place for a run script; the sysv init script is in /etc/init.d

Lorenzo

#23 Re: Installation » install s6 init system » 2023-04-25 22:39:33

Hi,

happy to be wrong about this, but as far as I know there is no s6-init package in Devuan.. you can install the s6 package, but all the init integration is not provided, so you have to serve yourself.

According to https://www.devuan.org/os/init-freedom s6 is supported, but I cannot manage to select it.

That page says " either available or being considered for inclusion "; I think only runit and openrc are provided as alternative init *for now*

Lorenzo

#24 Other Issues » runit-services: new package available ! » 2023-02-13 22:37:02

Lorenzo
Replies: 3

Hi all,

an official package that contains runit services is finally available in unstable and testing.
Could be especially useful for runit-init users that are no expert or don't have the time
to write the scripts.
For now the number of scripts is limited [1] (other scripts will be added after
incoming Debian release); if a script for a service you are using is missing you can
file a wishlist bug report against the Debian package so that I can prioritize scripts
that are actually requested by users.
Also, reports or questions about the package are welcome too

To install just do

apt-get install runit-services

To understand how this package works I recommend to read
https://salsa.debian.org/Lorenzo.ru.g-g … ter/README
before installing.

Best,
Lorenzo

[1] available services are:
acpi-fakekey,
anacron
apache2
atd
chrony
cron
cups
dbus
dhclient
elogind
exim4
gdomap
haveged
isc-dhcp-server
lightdm
lircd
mariadb
mdadm
openntpd
postfix
preload
proftpd
rsyslog
sddm
slim
wicd
xdm

#25 Re: Packaging for Devuan » avahi-daemon doesn't have init script since v0.8-8 » 2023-02-13 21:59:14

Hi,

scripts for avahi-daemon and avahi-dnsconfd have been added
to the latest orphan-sysvinit-scripts version (0.13)

Lorenzo

Board footer

Forum Software