Skip to main content
Topic: openrc is overwriting user settings with every update (Read 634 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

openrc is overwriting user settings with every update

Hello,

I don't need 6 virtual ttys, probably 99% of people don't need 6 virtual ttys.
So I disabled 4 of them with  rc-update delete agetty.tty3
But my settings get overwritten in Windows style from every openrc update.
This is what worked for me to enforce my settings:
Code: [Select]
sudo cp -af /usr/bin/true /etc/init.d/agetty.tty3
sudo chattr +/etc/init.d/agetty.tty3
sudo cp -af /usr/bin/true /etc/init.d/agetty.tty4
sudo chattr +/etc/init.d/agetty.tty4
And so on for every virtual tty you don't want.

Re: openrc is overwriting user settings with every update

Reply #1
I'm by no means an OpenRC expert, but I think the problem aren't the files in /etc/init.d/ (which you shouldn't mess with for such purposes), but rather those in /etc/runlevels/default/, some of which indeed seem to be tracked by pacman and would thus be re-created when openrc is updated.

Re: openrc is overwriting user settings with every update

Reply #2
I found runit & dinit can also overwrite custom configs. A lot of work has to be actually done in order to add all required configs to backup, i hope someone could take it...
ARMtix

Re: openrc is overwriting user settings with every update

Reply #3
Yeah... Here the desired "configuration" is essentially to delete a file that belongs to the package. Somehow the file should be marked in the PKGBUILD as "if not already present, do not create during update". I'm not actually sure if pacman can even handle that at present.

Re: openrc is overwriting user settings with every update

Reply #4
In the OpenRC PKGBUILD some files are marked as configuration files:
Code: [Select]
    backup=('etc/rc.conf'
            'etc/conf.d/consolefont'
            'etc/conf.d/keymaps'
            'etc/conf.d/hostname'
            'etc/conf.d/modules'
            'etc/conf.d/hwclock'
            'etc/conf.d/opentmpfiles-dev'
            'etc/conf.d/opentmpfiles-setup'
            'etc/conf.d/udev'
            'etc/conf.d/udev-trigger'
            'etc/conf.d/udev-settle'
            'etc/conf.d/agetty.tty'{1,2,3,4,5,6})
You might be able to do something using /etc/conf.d instead. Certainly that is where you set up auto login for startx and that works, resulting in a .pacnew file rather than your changes being wiped. One thing that is definitely missing from that list is /etc/conf.d/netmount, because every time you edit it to get rid of the "needs net" warning at boot, it gets overwritten on the next openrc update. It's been discussed here before but is still like that. Although those extra gettys are services and might look significant, I'm not sure you save anything measurable by disabling them though, compared to the millions of lines of code in everything else like the kernel and desktop stuff - OpenRC is a pretty small package and they represent just a tiny part of that. If you have several you can use them like terminal tabs if you lose the desktop due to a bug, so you can have different directories and files open at the same time which can make it easier.

Re: openrc is overwriting user settings with every update

Reply #5
'chattr +i' works for me, I suppose.To prevent disk errors, I've made my /etc/conf.d/killprocs file immutable. Since my qBittorrent transfers list has many entries, the app often fails to shut down correctly in time. Setting kill_delay=4 helps until the next openRC upgrade. While I can't catch every package update each time, I occasionally notice fsck errors during system boot after a killprocs rewrite.
 Thanks @Andy !

Re: openrc is overwriting user settings with every update

Reply #6
Another way of preventing pacman clobbering files you've modified is NoUpgrade, or NoExtract if you just want them gone, in pacman.conf

Spoiler (click to show/hide)

Re: openrc is overwriting user settings with every update

Reply #7
Never tried it myself, but you might modify rc.conf parameter rc_tty_number

artist
Linux is simple; use Artix, or Submit Your System To Evil Malicious D(a)emons

Re: openrc is overwriting user settings with every update

Reply #8
Yeah... Here the desired "configuration" is essentially to delete a file that belongs to the package. Somehow the file should be marked in the PKGBUILD as "if not already present, do not create during update". I'm not actually sure if pacman can even handle that at present.


That is not necessarily possible when updated the packages.  Sometimes a package wants to create sane settings for config files where things change from release to release.  There is no easy, one size fits all, answer to this.

 
Artix forum uses a single cookie to remember youOK