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"
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
(In reply to comment #1) Yes, my previous description is inaccurate...
(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.
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.
(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.
(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.
(In reply to comment #6) thus your setup has no relevance to my comment #4
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)
Created attachment 297517 [details] emerge --info emerge --info
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
(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
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.
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.
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.
Would it make sense to have {do,new}tmpfilesd (similar to {do,new}confd) in eutils and/or next EAPI?
This bug can be closed, no? tmpfiles.d works fine for me in stable openrc-0.11.8.
@robbat2: I am closing this for now. If it should be re-opened, feel free to do so.
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