Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917135 - sys-apps/systemd-utils-254.5-r2 tmpfiles cleanup hangs on fifos
Summary: sys-apps/systemd-utils-254.5-r2 tmpfiles cleanup hangs on fifos
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-10 18:50 UTC by Alex Efros
Modified: 2024-03-30 06:22 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2023-11-10 18:50:19 UTC
I'm using sys-process/dcron-4.5-r2 and don't use systemd. But I do use udev:

  sys-apps/systemd-utils-254.5-r2 pulled in by:
    virtual/libudev-251-r2 requires >=sys-apps/systemd-utils-251[udev,abi_x86_32(-),abi_x86_64(-)]
    virtual/tmpfiles-0-r5 requires sys-apps/systemd-utils[tmpfiles]
    virtual/udev-217-r7 requires sys-apps/systemd-utils[udev]

As a result of these deps I get installed /etc/cron.daily/systemd-tmpfiles-clean, which hangs when executed and thus result in hanging the whole cron service (because it waits until this script will exits).

Not sure what's the problem is, here is tail of strace output:

# strace -ff systemd-tmpfiles --clean
...
read(5, "", 1024)                       = 0
close(5)                                = 0
statx(4, "ad_mailbox_2880_0_6_evt_subevt_10", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_TYPE|STATX_MODE|STATX_UID|STATX_ATIME|STATX_MTIME|STATX_CTIME|STATX_BTIME, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFIFO|0777, stx_size=0, ...}) = 0
openat(4, "ad_mailbox_2880_0_6_evt_subevt_10", O_RDONLY|O_NOFOLLOW|O_NOATIME|O_CLOEXEC

Unrelated to this issue, but I prefer to have no systemd-related cron tasks on system which doesn't use systemd at all.
Comment 1 Mike Gilbert gentoo-dev 2023-11-11 21:47:53 UTC
Is there something special about your system that causes that openat call to hang?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-11 22:21:35 UTC
selinux, apparmor, etc, perhaps?

emerge --info would be useful too.
Comment 3 Alex Efros 2023-11-12 05:13:27 UTC
(In reply to Mike Gilbert from comment #1)
> Is there something special about your system that causes that openat call to
> hang?

No idea.

(In reply to Sam James from comment #2)
> selinux, apparmor, etc, perhaps?
> 
> emerge --info would be useful too.

Portage 3.0.51 (python 3.11.5-final-0, default/linux/amd64/17.1/hardened, gcc-13, glibc-2.37-r7, 6.1.57-gentoo x86_64)
=================================================================
System uname: Linux-6.1.57-gentoo-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.37
KiB Mem:    32808256 total,   5641004 free
KiB Swap:   16776896 total,  16774336 free
Timestamp of repository gentoo: Fri, 10 Nov 2023 17:00:01 +0000
Head commit of repository gentoo: 166f15fd8828d25fe1b882814bc88e2155e0c418
Timestamp of repository steam-overlay: Tue, 07 Nov 2023 05:37:13 +0000
Head commit of repository steam-overlay: ff5e56891b292cb2f9c62b257f986919bd4cfb4d

Timestamp of repository torbrowser: Wed, 08 Nov 2023 07:48:45 +0000
Head commit of repository torbrowser: a3cc880a8478bd26ee7c28e3cc3eea535be68f46

sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
ccache version 4.8.2 [enabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.10.13::gentoo, 3.11.5::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-util/ccache:           4.8.2::gentoo
dev-util/cmake:            3.26.5-r2::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r7::gentoo
sys-libs/libselinux:       3.5-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

local
    location: /usr/local/portage
    masters: gentoo
    priority: 0
    volatile: True

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

torbrowser
    location: /var/db/repos/torbrowser
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/torbrowser.git
    masters: gentoo
    volatile: False

powerman
    location: /home/powerman/proj/gentoo/powerman-overlay
    masters: gentoo
    priority: 50
    volatile: True

Installed sets: @esteam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /service /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/i2p/scripts /usr/share/maven-bin-3.9/conf /var/log"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage-distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --autounmask --autounmask-write --alert=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live ccache clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ http://mirrors.aliyun.com/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en ru ru_RU"
MAKEOPTS="-j24"
PKGDIR="/usr/portage-packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/zsh"
USE="X a52 aac acl acpi aes alac alsa amd64 avx avx2 bash-completion bluetooth branding bzip2 cairo caps cdda cddb cdr cet chm cli crypt cups dbus dcron dga djvu dri dts dvb dvd dvdr egl eglfs elogind emboss encode exif f16c fam ffmpeg flac fma3 fontconfig fortran gallium gdbm gif gpg gtk hardened heif iconv icu id3tag idn ipv6 jpeg jpeg2k lcms libnotify libtirpc mac mad matroska mmx mmxext mng mp3 mp4 mpeg mtp multilib musepack ncurses network-cron nls nptl nsplugin ogg opengl openmp opus pam pango pclmul pcre pdf perl pie png policykit popcnt ppds qt5 rdrand readline rtc sdl seccomp sha spell split-usr sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssp ssse3 startup-notification svg tcpd test-rust theora tiff truetype udev udisks unicode upower usb vaapi vdpau vim-syntax vorbis wavpack wxwidgets x264 x265 xattr xcb xml xscreensaver xtpax xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="log_config vhost_alias autoindex alias rewrite dir deflate filter mime negotiation auth_basic authn_file authz_host authz_user authz_groupfile cgi actions headers env setenvif authn_core authz_core unixd socache_shmcb access_compat" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi addition fancyindex" NGINX_MODULES_STREAM="ssl_preread map" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 4 Alex Efros 2023-11-12 05:18:30 UTC
(In reply to Sam James from comment #2)
> selinux, apparmor, etc, perhaps?

No and no.

Only special about my system is I use runit to both boot system and run services instead of openrc/systemd.
Comment 5 Alex Efros 2024-03-28 20:05:52 UTC
(Re)Emerging sys-apps/systemd-utils-254.8 result in changing permissions for /etc/cron.daily/systemd-tmpfiles-clean from non-executable (permission set manually) to executable.

Should I report this as a separate issue?
Comment 6 Alex Efros 2024-03-28 20:10:01 UTC
Also I can't emerge sys-apps/systemd-utils with USE=-tmpfiles because:
    sys-apps/systemd-utils[tmpfiles] required by (virtual/tmpfiles-0-r5:0/0::gentoo, installed) USE="-systemd" ABI_X86="(64)"
And I can't unmerge virtual/tmpfiles because it is required by 25 other packages.

So… why virtual/tmpfiles with USE="-systemd" required sys-apps/systemd-utils[tmpfiles]?
Comment 7 Mike Gilbert gentoo-dev 2024-03-28 21:15:03 UTC
I removed the cleanup options tmp.conf in systemd-utils.

I have no idea what would cause openat to hang your system. You will need to debug that further yourself.

Regarding the mode on /etc/cron.daily/systemd-tmpfiles-clean, Portage doesn't config-protect the mode. You could simply remove the file entirely as a workaround, which Portage should respect.
Comment 8 Alex Efros 2024-03-28 21:25:14 UTC
(In reply to Mike Gilbert from comment #7)
> I have no idea what would cause openat to hang your system. You will need to
> debug that further yourself.

Any ideas how to debug it further? I don't know systemd internals so for now strace is the last step which comes to my mind and I've no idea how to bisect this further.

> Regarding the mode on /etc/cron.daily/systemd-tmpfiles-clean, Portage
> doesn't config-protect the mode. You could simply remove the file entirely
> as a workaround, which Portage should respect.

I don't like to remove such files because it's hard to find out later which ones were removed and what should be re-emerged to restore them. Making these files (non)executable is a standard way to configure cron, so maybe portage should be improved to protect their mode?
Comment 9 Mike Gilbert gentoo-dev 2024-03-28 21:36:27 UTC
I agree that having portage config protect the file mode would be nice. I think there is already a bug open for that, but I cant find it at the moment.
Comment 10 Enne Eziarc 2024-03-29 01:21:43 UTC
systemd-tmpfiles follows the XDG config path standard (man 5 tmpfiles.d), so if you figure out which file in /usr/lib/tmpfiles.d causes the hang and create a blank one with the same name in /etc/tmpfiles.d, it will disable that part.

I'm using it under runit and cronie with no hangs fwiw, although it does regularly pollute my inbox with cronspam about non-fatal error conditions.
Comment 11 Alex Efros 2024-03-29 17:35:07 UTC
(In reply to Enne Eziarc from comment #10)
> systemd-tmpfiles follows the XDG config path standard (man 5 tmpfiles.d), so
> if you figure out which file in /usr/lib/tmpfiles.d causes the hang and
> create a blank one with the same name in /etc/tmpfiles.d, it will disable
> that part.

`touch /etc/tmpfiles.d/tmp.conf` fixes the hang.

File /usr/lib/tmpfiles.d/tmp.conf contains these two lines:

  q /tmp 1777 root root 10d
  q /var/tmp 1777 root root 30d

Removing first line also fixes the hang.

# ls -ld /tmp /var/tmp
drwxrwxrwt 170 root root 225280 Mar 29 19:34 /tmp
drwxrwxrwt   5 root root   4096 Mar 29 19:31 /var/tmp
Comment 12 Mike Gilbert gentoo-dev 2024-03-29 18:20:30 UTC
I found an issue upstream.
Comment 13 Mike Gilbert gentoo-dev 2024-03-29 18:22:26 UTC
The hang issue should be fixed in systemd-utils-254.10.
Comment 14 Alex Efros 2024-03-30 06:22:04 UTC
(In reply to Mike Gilbert from comment #13)
> The hang issue should be fixed in systemd-utils-254.10.

I can confirm this version won't hang. Thanks!