Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396003 - sys-apps/openrc: tmpfiles.d support
Summary: sys-apps/openrc: tmpfiles.d support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on: 361349
Blocks: 333821 446948
  Show dependency tree
 
Reported: 2011-12-25 16:47 UTC by Casper Ti. Vector
Modified: 2015-10-18 06:14 UTC (History)
11 users (show)

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


Attachments
emerge --info (emerge.info,8.86 KB, text/plain)
2012-01-01 12:45 UTC, Daniel Schömer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Casper Ti. Vector 2011-12-25 16:47:03 UTC
screen(1) from app-misc/screen complains when called by a regular user:
> Cannot make directory '/var/run/screen': Permission denied
It seems that `/var/run/screen' is removed on every shutdown even when `/run' is a separate directory.

Output of `emerge --info screen':
Portage 2.1.10.43 (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.14.1-r1, 3.1.5-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.1.5-gentoo-x86_64-Intel-R-_Pentium-R-_Dual_CPU_T2370_@_1.73GHz-with-gentoo-2.1
Timestamp of tree: Sun, 25 Dec 2011 12:45:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.7
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1-r1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r1::caspervector
Repositories: gentoo gentoo-haskell gentoo-zh caspervector
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
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=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fakeroot fixlafiles metadata-transfer news parallel-fetch parallel-install protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersync"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.bjtu.edu.cn/gentoo http://mirrors.ustc.edu.cn/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--human-readable"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/haskell /var/lib/layman/gentoo-zh /usr/local/portage"
SYNC="rsync://rsync.cn.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig fortran gdu gif gnutls gpg gpm gtk gtk3 iconv ipv6 jpeg lcms libedit libnotify mad maildir mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf png policykit ppds pppd qt3support qt4 readline sdl session smp socks5 spell sse sse2 sse3 ssl ssse3 startup-notification svg sysfs system-sqlite tcpd threads tiff truetype udev unicode usb vorbis x264 xcb xft xinerama xml xorg xulrunner xv xvid zlib zsh-completion" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

app-misc/screen-4.0.3-r4 was built with the following:
USE="(multilib) pam -debug -multiuser -nethack (-selinux)"
CFLAGS="-march=nocona -O2 -pipe -DMAXWIN=100 -DNONETHACK"
CXXFLAGS="-march=nocona -O2 -pipe -DMAXWIN=100 -DNONETHACK"
Comment 1 SpanKY gentoo-dev 2011-12-27 00:57:55 UTC
this has already been mentioned in Bug 361349 (comment 41)

it's only an issue when /run exists because /var/run is just a symlink to it
Comment 2 Casper Ti. Vector 2011-12-27 04:48:25 UTC
(In reply to comment #1)
Yes, my previous description is inaccurate...
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-12-29 03:31:11 UTC
(In reply to comment #1)
> it's only an issue when /run exists because /var/run is just a symlink to it

Hit this problem; however, on my system (with openrc-0.9.7), /var/run is not a symlink to /run, and in fact the contents of /run and /var/run are different.
Comment 4 SpanKY gentoo-dev 2011-12-31 20:29:49 UTC
if you're manually mounting /var/run as tmpfs or otherwise clearing it, that is currently "your" problem

if you have /run and your /var/run isn't a symlink to it, then your system needs updating.  we'll be adding checks to openrc to handle/force the migration.
Comment 5 Martin Jansa 2011-12-31 20:45:51 UTC
(In reply to comment #4)
> if you're manually mounting /var/run as tmpfs or otherwise clearing it, that is
> currently "your" problem
> 
> if you have /run and your /var/run isn't a symlink to it, then your system
> needs updating.  we'll be adding checks to openrc to handle/force the
> migration.

My /var/run is symlink to /run and /run is tmpfs, using sys-apps/openrc-0.9.7.
I have the same problem /var/run/screen is missing after each reboot.
Comment 6 Casper Ti. Vector 2012-01-01 06:30:35 UTC
(In reply to comment #4)

Thanks for your explanation, but
1. Though /run is mounted as tmpfs according to the output of mount(1), this is not done manually by me.
2. /var/run on my system is a symlink to /run, and /var/lock is a link to /run/lock, therefore I think I can confirm that I have already completed the migration.
Comment 7 SpanKY gentoo-dev 2012-01-01 07:12:11 UTC
(In reply to comment #6)

thus your setup has no relevance to my comment #4
Comment 8 Daniel Schömer 2012-01-01 12:44:54 UTC
I can confirm this bug. After each reboot, directory /var/run/screen is missing. Since /var/run symlinks to /run and /run is mounted as tmpfs, /run is empty after each reboot and /var/run/screen does not exist.

/var/run/screen needs to be created after /run is mounted as tmpfs.

This could be done by openrc (since sys-apps/openrc-0.9.7 mounts /run in /lib/rc/sh/init.sh at line 103), by a script supplied by app-misc/screen, by /etc/init.d/local, or maybe something else. What would be the right place to create /var/run/screen?

$ screen
Cannot make directory '/var/run/screen': Permission denied

$ ls -ld /var/run/screen
ls: cannot access /var/run/screen: No such file or directory

$ ls -l /var/run
lrwxrwxrwx 1 root root 4 Dec 11 14:29 /var/run -> /run

$ mount | fgrep /run
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)

# mkdir /var/run/screen
# chmod 4775 /var/run/screen
# chgrp utmp /var/run/screen
# ls -ld /var/run/screen
drwsrwxr-x 2 root utmp 40 Jan  1 13:33 /var/run/screen

$ screen
(starts a new screen session)
Comment 9 Daniel Schömer 2012-01-01 12:45:31 UTC
Created attachment 297517 [details]
emerge --info

emerge --info
Comment 10 William Hubbs gentoo-dev 2012-01-05 13:44:26 UTC
I am re-titling this bug, because we are going to create tmpfiles.d
support for openrc [1]. This will solve this issue.

[1] http://0pointer.de/public/systemd-man/tmpfiles.d.html
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-06 15:06:41 UTC
(In reply to comment #10)
> I am re-titling this bug, because we are going to create tmpfiles.d
> support for openrc [1]. This will solve this issue.
> 
> [1] http://0pointer.de/public/systemd-man/tmpfiles.d.html

Please consider moving /run/lock creation to that method as well then [1].

[1]:http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=blob;f=sys-apps/systemd/files/gentoo-run.conf
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-03-12 08:39:37 UTC
Ok, the base of this is in the tree.

http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c75352af3d787377c4aa62baa1331f37db3d1d97

It needs LOTS of testing still, and some clarifications from upstream.
Then we need to figure out where to install the tmpfiles.d/*.conf files so that systemd & openrc don't conflict.
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-03-12 08:40:40 UTC
This will be going out in OpenRC 0.10 after more user testing.
Please test it! You're going to have to write your own tests as well.
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-11 21:52:03 UTC
Another user who needs tmpfiles.d is proftpd in inetd mode (/var/rn -> /run/).
It does not start anything from /etc/init.d thus you get problems when try to connect to it:

> Jul 12 00:25:03 sf xinetd[7742]: START: ftp pid=26896 from=127.0.0.1
> Jul 12 00:25:03 sf proftpd[26896]: notice: unable to bind to Unix domain socket at '/var/run/proftpd/test.sock': No such file or directory


Manually creating /var/run/proftpd/ helps.
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-21 14:00:55 UTC
Would it make sense to have {do,new}tmpfilesd (similar to {do,new}confd) in eutils and/or next EAPI?
Comment 16 Maxim Kammerer 2013-01-01 21:34:03 UTC
This bug can be closed, no? tmpfiles.d works fine for me in stable openrc-0.11.8.
Comment 17 William Hubbs gentoo-dev 2013-01-06 18:08:52 UTC
@robbat2:
I am closing this for now. If it should be re-opened, feel free to do
so.
Comment 18 Thomas Stein 2013-01-25 08:35:11 UTC
Hello.

I now have problems starting zabbix and nrpe because the directorys /var/run/nrpe and /var/run/zabbix are gone after reboot. Is this supposed to work?

best regards
Thomas