Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438050 - media-sound/teamspeak-server-bin does not start due to missing /var/run/teamspeak3
Summary: media-sound/teamspeak-server-bin does not start due to missing /var/run/teams...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Proxy Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-10-11 23:21 UTC by Phil Stracchino (Unix Ronin)
Modified: 2012-12-21 19:24 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 Phil Stracchino (Unix Ronin) 2012-10-11 23:21:29 UTC
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.
Comment 1 Jarry 2012-12-15 19:53:20 UTC
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...
Comment 2 Phil Stracchino (Unix Ronin) 2012-12-16 20:57:05 UTC
(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.
Comment 3 Jarry 2012-12-17 18:28:03 UTC
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).
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2012-12-18 09:34:52 UTC
(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
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2012-12-18 09:35:39 UTC
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
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2012-12-21 19:24:40 UTC
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>
+