The officially official Devuan Forum!

You are not logged in.

#1 2024-07-02 22:44:21

stribika
Member
Registered: 2024-07-02
Posts: 2  

How do I stop apt deleting stuff from /etc/service?

Hello,
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. There is a non-functional /etc/init.d/elogind which I have replaced with a symlink to /bin/sv. This also keeps getting reverted. The weirdest thing is this can happen when installing seemingly unrelated packages,

Ideally, I would like to protect these directories like other config files on the system, so that I can at least have a chance to compare the package's version with my version.

Offline

#2 2024-07-02 23:30:25

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 639  

Re: How do I stop apt deleting stuff from /etc/service?

Hi stribika,

Your situation has not happened to my system, but

you could try setting the immuteable attribute to the file with...

chattr +i (absolute path to file)

At least you'll get a chance to see if it works without breaking the system.

you may remove the attribute with

chattr -i (absolute path to file)

I realise it's a hack, but it may sustain you untill there is a proper solution (I use openrc, not runit). All the best.


pic from 1993, new guitar day.

Offline

#3 2024-07-05 09:16:02

stribika
Member
Registered: 2024-07-02
Posts: 2  

Re: How do I stop apt deleting stuff from /etc/service?

That's a good idea. I protected /etc/runit/runsvdir/default, so the next time something tries to remove symlinks from there, it will fail and hopefully tell me about it. Leaving like this would be pretty inconvenient, but it should provide enough info for a bug report.

Offline

#4 2024-07-05 21:30:39

Lorenzo
Member
Registered: 2020-03-03
Posts: 43  

Re: How do I stop apt deleting stuff from /etc/service?

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

Offline

Board footer