Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917777 - sys-apps/systemd-utils-254.5-r2[tmpfiles] can break created www-servers/tomcat instances
Summary: sys-apps/systemd-utils-254.5-r2[tmpfiles] can break created www-servers/tomca...
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-23 03:48 UTC by Pavel Goran
Modified: 2024-03-28 21:12 UTC (History)
2 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 Pavel Goran 2023-11-23 03:48:24 UTC
The tomcat-instance-manager.bash script from www-servers/tomcat is used to create "instances" of Tomcat installation, which consist of several directories that are used by a running Tomcat and the init scripts.

Among these created directories is /var/tmp/${RC_SVCNAME}. The presence of this directory is required to start Tomcat: it's the first thing that the init script checks, and if the directory doesn't exist, the init script reports an error and refuses to start the service.

Now, sys-apps/systemd-utils254.5-r2[tmpfiles] installs the tmpfiles configuration file /usr/lib/tmpfiles.d/tmp.conf which includes the following line:

q /var/tmp 1777 root root 30d

This means that Tomcat instance's temporary directory is deleted in 30 days after it was last touched (for example, if this particular instance isn't run for more than 30 days). Which makes the instance un-startable. I can imagine it even affecting a Tomcat instance that is running for more than 30 days.

I encountered this problem with an instance of (outdated) tomcat-7.0.109-r1. However, my instance of tomcat-8.5.95-r1 (created with a much older version of tomcat:8.5) was also broken by this. Also, I looked through the currently installed 'tomcat-instance-manager.bash' and 'tomcat.init', and didn't see anything that would prevent this issue, so apparently newly created instances of Tomcat will suffer from it, as well.


Reproducible: Always

Steps to Reproduce:
1. Create a Tomcat instance by running '/usr/share/tomcat-8.5/gentoo/tomcat-instance-manager.bash --create'
2. Wait for 30 days.
3. Attempt to start the instance with '/etc/init.d/tomcat-8.5 start'.

Actual Results:  
The instance fails to start, giving a error like this:

tomcat-8.5-test            | * Starting tomcat-8.5-test ...
tomcat-8.5-test            | * CATALINA_TMPDIR does not exist. Unable to start tomcat.
tomcat-8.5-test            | * Please see /etc/conf.d/tomcat-8.5-test for more information.

Expected Results:  
The instance starts successfully.

$ emerge --info
Portage 3.0.51 (python 3.10.13-final-0, default/linux/amd64/17.1/desktop, gcc-12, glibc-2.37-r7, 6.5.0-pf5-dracut051 x86_64)
=================================================================
System uname: Linux-6.5.0-pf5-dracut051-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-glibc2.37
KiB Mem:    32760516 total,   2513712 free
KiB Swap:   41943036 total,  36953852 free
Timestamp of repository gentoo: Fri, 17 Nov 2023 09:00:01 +0000
Head commit of repository gentoo: c50e2a9894174a216632f2aba67b07dc5dc55853
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
distcc 3.4 x86_64-pc-linux-gnu [enabled]
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:           2.7.18_p16-r1::gentoo, 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.2-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::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:           15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230825::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:            15.0.7-r3::gentoo, 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
Repositories:

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

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

java
    location: /var/lib/layman/java
    masters: gentoo
    priority: 50
    volatile: True

mv
    location: /var/lib/layman/mv
    masters: gentoo
    priority: 50
    volatile: True

nix-guix
    location: /var/lib/layman/nix-guix
    masters: gentoo
    priority: 50
    volatile: True

palemoon
    location: /var/lib/layman/palemoon
    masters: gentoo
    priority: 50
    volatile: True

ssnb
    location: /var/lib/layman/ssnb
    masters: gentoo
    priority: 50
    volatile: True

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50
    volatile: True

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 1000
    volatile: True

Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Broadcom dlj-1.1 AdobeFlash-10.3 FraunhoferFDK Vivaldi RAR"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -finline-functions -frename-registers -pipe -march=nocona"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/i18n/locales/en_US /usr/share/maven-bin-3.9/conf /var/lib/i2pd/certificates"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-Os -finline-functions -frename-registers -pipe -march=nocona"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask n --autounmask-keep-masks y --verbose-conflicts"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live ccache config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ http://gentoo.mirror.web4u.cz/ http://mirrors.linuxant.fr/distfiles.gentoo.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en ru"
MAKEOPTS="-j18 -l12"
PKGDIR="/var/cache/binpkgs"
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/bash"
USE="3dnow 3dnowext 7zip X a52 aac acl acpi aio alsa amd64 ao apache2 arts atm avahi avfs bash-completion bazaar binfilter bluetooth branding bzip2 cairo caps cdda cdr cgi chm cli console crypt cups curl custom-optimization cxx dbus dell device-mapper dhcp dillo dirac directfb disk-partition djvu dri dts dvd dvdr ebook elogind enca encode epub evo examples exif expat faac fat fbcon fbsplash fdk festival ffmpeg fftw flac fontconfig fortran ftp fts3 fuse gajim gcj gdbm gdu gif git gmp gnome gnome-keyring gnutls gpg gphoto2 gpm gsf gstreamer gtk gucharmap gui gzip hardcoded-tables hddtemp htmlhandbook iconv icu idle imap ipv6 ithreads jack jadetex java java5 java6 javascript jfs jingle jpeg jpeg2k kde lame laptop lcms libass libffi libnotify libsamplerate libtirpc lm_sensors log4j lz4 lzma lzo mad mate matroska mercurial mjpeg mmap mmxext mng mobi mod modemmanager modplug mp3 mp4 mpeg mplayer mtp multilib mysql mysqli ncurses netbeans nls nptl nsplugin ntfs odbc ogg openal opengl openmp openssl oss pam pango pcre pdf perl png policykit postgres ppds pulseaudio python qt5 quicktime radius rar rdesktop rdp readline reiserfs samba schroedinger sdl seccomp session sftp slang smime smp sockets socks5 sound spell split-usr sql sqlite sqlite3 srv ssl ssse3 startup-notification subtitles subversion svg systray taglib tcl test-rust theora threads tiff tk trayicon truetype type1 udev udisks unicode upower usb userlocales v4l v4l2 vcd vdpau vhosts vnc vorbis vpx vulkan wavpack wma wmf wxwidgets x264 xattr xcb xcomposite xetex xfce xfs xft xhtml xml xrender xscreensaver xulrunner xv xvid zip zlib zstd" ABI_X86="64 32" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 sse4_1 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" INPUT_DEVICES="keyboard mouse evdev synaptics" 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3 php5-4 php5-6" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby31" VIDEO_CARDS="vga vesa nv nouveau radeon r600 amdgpu intel" 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 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 00:36:01 UTC
Thanks. I feel like we should just drop it from systemd-utils at this point.
Comment 2 Pavel Goran 2023-11-27 04:30:48 UTC
(In reply to Sam James from comment #1)
> Thanks. I feel like we should just drop it from systemd-utils at this point.

If you mean removing (or disabling) /usr/lib/tmpfiles.d/tmp.conf, then it's probably the most appropriate solution for all these bugs.
Comment 3 Larry the Git Cow gentoo-dev 2024-03-28 21:12:28 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dafe17091a2bfa128ee7f706d63e76cc42e4c58f

commit dafe17091a2bfa128ee7f706d63e76cc42e4c58f
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-03-28 21:09:36 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-03-28 21:12:06 +0000

    sys-apps/systemd-utils: disable auto-cleanup of /tmp and /var/tmp
    
    This can go awry when people have non-standard mount options for these
    paths.
    
    Closes: https://bugs.gentoo.org/910233
    Bug: https://bugs.gentoo.org/916623
    Closes: https://bugs.gentoo.org/917777
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/systemd-utils/files/tmp.conf                                 | 2 ++
 .../{systemd-utils-254.10.ebuild => systemd-utils-254.10-r1.ebuild}   | 4 ++--
 .../{systemd-utils-254.8.ebuild => systemd-utils-254.8-r1.ebuild}     | 4 ++--
 sys-apps/systemd-utils/systemd-utils-255.4.ebuild                     | 4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)