Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unwanted systemd files [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Thu Mar 23, 2023 10:50 pm    Post subject: unwanted systemd files [SOLVED] Reply with quote

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
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1531
Location: South America

PostPosted: Thu Mar 23, 2023 11:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Thu Mar 23, 2023 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1531
Location: South America

PostPosted: Thu Mar 23, 2023 11:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Thu Mar 23, 2023 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1531
Location: South America

PostPosted: Fri Mar 24, 2023 12:03 am    Post subject: Reply with quote

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
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Fri Mar 24, 2023 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Fri Mar 24, 2023 7:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Fri Mar 24, 2023 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Fri Mar 24, 2023 7:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
stefan11111
l33t
l33t


Joined: 29 Jan 2023
Posts: 922
Location: Romania

PostPosted: Fri Mar 24, 2023 7:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Fri Mar 24, 2023 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum