teamspeak-server from the media-sound/teamspeak-server-bin package will not start unless /var/run/teamspeak3 exists. However, on a current Gentoo install (bare metal install about 2 weeks old), /var/run is a symlink to /run, and /run is tmpfs, so /var/run/teamspeak3 does not exist after reboot, and /etc/init.d/teamspeak-server does not check for it or create it if missing. This is a perfectly simple two-line fix to the startup script: --- /etc/init.d/teamspeak3-server.orig 2012-09-16 21:24:46.972592084 -0400 +++ /etc/init.d/teamspeak3-server 2012-10-11 19:18:33.537083800 -0400 @@ -17,6 +17,9 @@ # temporay fix for EPERM bug (we still leave it here to make sure it is *really* not there) rm -f /dev/shm/7gbhujb54g8z9hu43jre8 + [ -d /var/run/teamspeak3-server ] || mkdir /var/run/teamspeak3-server + chown teamspeak3:teamspeak3 /var/run/teamspeak3-server + start-stop-daemon --start --quiet --background \ --pidfile "/var/run/teamspeak3-server/server.pid" --make-pidfile \ --user "teamspeak3" --chdir "/opt/teamspeak3-server" \ Reproducible: Always Steps to Reproduce: 1. Install and configure teamspeak-server-bin 2. Reboot 3. rc-status -a and observe that teamspeak-server is marked as crashed.
I can confirm this bug on freshly installed gentoo server. I also have /run (and /var/run) on tmpfs, but after every reboot there is no more /var/run/teamspeak3-server but (surprisingly) only /var/run/teamspeak3. The fix Phil suggested works, but I do not think it is "clean" solution to create /var/run/teamspeak3-server always in start-up script. Instead of that I suggest to move simply pid-file to /var/run (i.e. /var/run/teamspeak3-server.pid). Other pid-files are saved there in the same way (cron, sshd, syslog, etc.) so I think we'd better stick with the scheme which works and is generaly used and accepted...
(In reply to comment #1) > The fix Phil suggested works, but I do not think it is "clean" solution to > create /var/run/teamspeak3-server always in start-up script. Instead of that > I suggest to move simply pid-file to /var/run (i.e. > /var/run/teamspeak3-server.pid). Other pid-files are saved there in the same > way (cron, sshd, syslog, etc.) so I think we'd better stick with the scheme > which works and is generaly used and accepted... My "fix" was more of a quick and dirty patch. Ultimately, I think the problem here is that if we are going to have applications that create their own subdirectories of /var/run at install time, and then expect those subdirectories to still exist after the next reboot, then putting /var/run on tmpfs is a bad idea in the first place. Any directory that we expect to contain persistent objects should not be on tmpfs unless we have a mechanism for recreating those persistent objects at boot, immediately after that particular tmpfs is mounted.
Well, bad idea or not, we have to live with it. I doubt we could now force openrc-devs to abandon the idea of /var/run on tmpfs (which I personaly think does not bring any advantage to users). It already went to stable, so every new gentoo-box is installed that way, and every software must account for that. I just suggested to do it the same way as for other servers: if only one single pid-file is needed, it can be saved directly to /var/run (like i.e. sshd, cron, syslog, vsftp, acpid, sendmail, and others). If more than one pid-file is necessary (or pid + sock + lock), start-up script must take care of creating sub-directory in /var/run (like mysqld, dovecot).
(In reply to comment #2) > (In reply to comment #1) > > The fix Phil suggested works, but I do not think it is "clean" solution to > > create /var/run/teamspeak3-server always in start-up script. Instead of that > > I suggest to move simply pid-file to /var/run (i.e. > > /var/run/teamspeak3-server.pid). Other pid-files are saved there in the same > > way (cron, sshd, syslog, etc.) so I think we'd better stick with the scheme > > which works and is generaly used and accepted... > > My "fix" was more of a quick and dirty patch. Ultimately, I think the > problem here is that if we are going to have applications that create their > own subdirectories of /var/run at install time, and then expect those > subdirectories to still exist after the next reboot, then putting /var/run > on tmpfs is a bad idea in the first place. Any directory that we expect to > contain persistent objects should not be on tmpfs unless we have a mechanism > for recreating those persistent objects at boot, immediately after that > particular tmpfs is mounted. The fix looks reasonable to me. I think many packages already create directories in run/ on every boot. For example, look at the dbus init script # We need to test if /var/run/dbus exists, since script will fail if it does not [ ! -e /var/run/dbus ] && mkdir /var/run/dbus
Is anyone willing to maintain this package? Proxy-maintainers can help you push your fixes to portage http://www.gentoo.org/proj/en/qa/proxy-maintainers/index.xml
anyway I pushed the fix for now + 21 Dec 2012; Markos Chandras <hwoarang@gentoo.org> files/teamspeak3-server.rc: + Apply fix from #438050 for missing /var/run/teamspeak3 server directory. + Thanks to Phil Stracchino <alaric@caerllewys.net> +