View previous topic :: View next topic |
Author |
Message |
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Thu Mar 23, 2023 10:50 pm Post subject: unwanted systemd files [SOLVED] |
|
|
I was looking into adding INSTALL_MASK="*systemd* *udev*" to my make.conf.
To see what this would break, I searched for all the files containing systemd.
To my unpleasant surprise, I found that, despite being extra careful not to have anything systemd-related on my system, I still have files that contain the name "systemd" or "udev" in them.
Code: | /usr/lib/systemd
/usr/lib/portage/python3.11/install-qa-check.d/60systemd
/usr/lib/systemd/user
/usr/lib/systemd/user/dirmngr.service
/usr/lib/systemd/user/dirmngr.socket
/usr/lib/systemd/user/gpg-agent-browser.socket
/usr/lib/systemd/user/gpg-agent-extra.socket
/usr/lib/systemd/user/gpg-agent-ssh.socket
/usr/lib/systemd/user/gpg-agent.service
/usr/lib/systemd/user/gpg-agent.socket
/lib/systemd
/lib/systemd/system
/lib/systemd/system-sleep
/lib/systemd/system/dhcpcd.service
/lib/systemd/system/e2scrub@.service
/lib/systemd/system/e2scrub_all.service
/lib/systemd/system/e2scrub_all.timer
/lib/systemd/system/e2scrub_fail@.service
/lib/systemd/system/e2scrub_reap.service
/lib/systemd/system/fancontrol.service
/lib/systemd/system/git-daemon.socket
/lib/systemd/system/git-daemon@.service
/lib/systemd/system/lm_sensors.service
/lib/systemd/system/man-db.service
/lib/systemd/system/man-db.timer
/lib/systemd/system/mit-krb5kadmind.service
/lib/systemd/system/mit-krb5kdc.service
/lib/systemd/system/mit-krb5kpropd.service
/lib/systemd/system/mit-krb5kpropd.socket
/lib/systemd/system/mit-krb5kpropd@.service
/lib/systemd/system/nmb.service
/lib/systemd/system/nmbd.service
/lib/systemd/system/ntpd.service
/lib/systemd/system/nvidia-hibernate.service
/lib/systemd/system/nvidia-powerd.service
/lib/systemd/system/nvidia-resume.service
/lib/systemd/system/nvidia-suspend.service
/lib/systemd/system/qbittorrent-nox@.service
/lib/systemd/system/rsyncd.service
/lib/systemd/system/smb.service
/lib/systemd/system/smbd.service
/lib/systemd/system/sshd.service
/lib/systemd/system/sshd.socket
/lib/systemd/system/sshd@.service
/lib/systemd/system/updatedb.service
/lib/systemd/system/updatedb.timer
/lib/systemd/system/winbind.service
/lib/systemd/system/winbindd.service
/lib/systemd/system-sleep/nvidia
|
Code: | /usr/lib/portage/python3.11/install-qa-check.d/60udev
/etc/udev
/etc/udev/hwdb.bin |
I am mostly concerned about these:
Code: | $ ls -lah /lib/systemd/system-sleep
total 12K
drwxr-xr-x 2 root root 4.0K Mar 23 02:36 .
drwxr-xr-x 4 root root 4.0K Mar 17 11:28 ..
-rwxr-xr-x 1 root root 92 Mar 23 02:35 nvidia |
Code: | $ ls -lah /etc/udev
total 12M
drwxr-xr-x 2 root root 4.0K Mar 17 11:28 .
drwxr-xr-x 53 root root 4.0K Mar 23 22:09 ..
-r--r--r-- 1 root root 12M Mar 17 11:27 hwdb.bin |
How did these get on my system?
Would removing them cause any problems? _________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev"
Last edited by stefan11111 on Fri Mar 24, 2023 11:57 pm; edited 1 time in total |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1531 Location: South America
|
Posted: Thu Mar 23, 2023 11:34 pm Post subject: |
|
|
Most are unit files (text files) that upstream packages install, which do nothing if you don't have systemd installed and running.
The /usr/lib/portage/python*/install-qa-check.d/* ones are for QA checks that Portage does for packages that install unit files and udev rules.
/etc/udev/hwdb.bin is the binary hadware database that udev uses. Unless you don't have udev installed and running, you need it.
/lib/systemd/system-sleep/nvidia is only used if you suspend or hibernate the computer using systemd's systemctl command, and also does nothing if you don't have systemd installed and running.
Just don't bother doing anything with them, figthing against installation of these files is not worth it. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Thu Mar 23, 2023 11:44 pm Post subject: |
|
|
GDH-gentoo wrote: | Most are unit files (text files) that upstream packages install, which do nothing if you don't have systemd installed and running.
The /usr/lib/portage/python*/install-qa-check.d/* ones are for QA checks that Portage does for packages that install unit files and udev rules.
/etc/udev/hwdb.bin is the binary hadware database that udev uses. Unless you don't have udev installed and running, you need it.
/lib/systemd/system-sleep/nvidia is only used if you suspend or hibernate the computer using systemd's systemctl command, and also does nothing if you don't have systemd installed and running.
Just don't bother doing anything with them, figthing against installation of these files is not worth it. |
I don't have udev installed on my system.
So it's fine if I remove them, but they won't cause any problems if I leave them there.
Would adding that mask cause any problems then?
I want it to keep portage from making any files or directories that have systemd or udev in their name. _________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev" |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1531 Location: South America
|
Posted: Thu Mar 23, 2023 11:49 pm Post subject: |
|
|
stefan11111 wrote: | So it's fine if I remove them, but they won't cause any problems if I leave them there. |
If you remove the ones that Portage uses, you risk breaking it. You don't want that. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Thu Mar 23, 2023 11:55 pm Post subject: |
|
|
GDH-gentoo wrote: | stefan11111 wrote: | So it's fine if I remove them, but they won't cause any problems if I leave them there. |
If you remove the ones that Portage uses, you risk breaking it. You don't want that. |
So only this one really is needed.
Code: | /usr/lib/portage/python3.11/install-qa-check.d/60udev |
_________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev" |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1531 Location: South America
|
Posted: Fri Mar 24, 2023 12:03 am Post subject: |
|
|
I wouldn' t remove or mess in any other way with the contents of /usr/lib/portage. It is asking for trouble. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Fri Mar 24, 2023 6:43 pm Post subject: |
|
|
I decided to test if the INSTALL_MASK is working as expected.
I came up with this:
Code: | INSTALL_MASK="systemd udev tmpfiles"
|
I emerged opentmpfiles to test it.
It got properly emerged and It created the following files, seemingly ignoring my mask:
Code: | >>> /etc/init.d/opentmpfiles-dev
>>> /etc/init.d/opentmpfiles-setup |
How should I fix my INSTALL_MASK? _________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev" |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Fri Mar 24, 2023 7:03 pm Post subject: |
|
|
According to man make.conf, you need INSTALL_MASK="opentmpfiles-dev opentmpfiles-setup" if you want to block those two files in every directory, or the full paths if you want to block only exactly what you showed. |
|
Back to top |
|
|
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Fri Mar 24, 2023 7:06 pm Post subject: |
|
|
Hu wrote: | According to man make.conf, you need INSTALL_MASK="opentmpfiles-dev opentmpfiles-setup" if you want to block those two files in every directory, or the full paths if you want to block only exactly what you showed. |
And what would be needed to keep my system free of any files containing systemd, udev, or tmpfiles anywhere in the filename or in the file path?
If I use the mask you suggested or Code: | INSTALL_MASK="*systemd* *udev* *tmpfiles*" | I still get those files, but this it the output from portage:
Code: | >>> Installing (1 of 1) sys-apps/opentmpfiles-0.2-r1::gentoo
* checking 1 files for package collisions
>>> Merging sys-apps/opentmpfiles-0.2-r1 to /
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/opentmpfiles-0.2-r1/
>>> /usr/share/doc/opentmpfiles-0.2-r1/README.md.bz2
--- /etc/
--- /etc/conf.d/
--- /etc/init.d/
--- /bin/
* Auto-adding 'opentmpfiles-dev' service to your sysinit runlevel
* Auto-adding 'opentmpfiles-setup' service to your boot runlevel
>>> sys-apps/opentmpfiles-0.2-r1 merged.
|
_________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev" |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Fri Mar 24, 2023 7:24 pm Post subject: |
|
|
As noted in man make.conf, globs are also supported. It looks to me like using globs produced exactly the result you requested. Why do you think that masked files were installed? Your Portage output says they were not. |
|
Back to top |
|
|
stefan11111 l33t
Joined: 29 Jan 2023 Posts: 922 Location: Romania
|
Posted: Fri Mar 24, 2023 7:58 pm Post subject: |
|
|
Hu wrote: | As noted in man make.conf, globs are also supported. It looks to me like using globs produced exactly the result you requested. Why do you think that masked files were installed? Your Portage output says they were not. |
After emerging opentmpfiles, I get these 2 files:
Code: | $ ls -lah /etc/runlevels/*/* | grep tmpfiles
lrwxrwxrwx 1 root root 30 Mar 24 21:56 /etc/runlevels/boot/opentmpfiles-setup -> /etc/init.d/opentmpfiles-setup
lrwxrwxrwx 1 root root 28 Mar 24 21:56 /etc/runlevels/sysinit/opentmpfiles-dev -> /etc/init.d/opentmpfiles-dev |
Both of these files are broken symlinks. _________________ My overlay: https://github.com/stefan11111/stefan_overlay
INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d *udev* /usr/lib/tmpfiles.d *tmpfiles* /var/lib/dbus /usr/bin/gdbus /lib/udev" |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Fri Mar 24, 2023 8:19 pm Post subject: |
|
|
Yes. INSTALL_MASK prevented the installation of /etc/init.d/opentmpfiles-setup and /etc/init.d/opentmpfiles-dev, so links pointing to them are broken. If you look at the ebuild, those symlinks are created in pkg_postinst, so they are outside the scope of INSTALL_MASK. |
|
Back to top |
|
|
|