Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204727 - Recent changes to media-sound/timidity++-2.13.2-r6 initscript broke things
Summary: Recent changes to media-sound/timidity++-2.13.2-r6 initscript broke things
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
: 203092 256233 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-07 08:59 UTC by Adam Nielsen
Modified: 2009-05-12 15:44 UTC (History)
13 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 Adam Nielsen 2008-01-07 08:59:53 UTC
It seems the recent change to load Timidity++ as the "timidity" user causes problems (-r5 worked fine, -r6 breaks.)

$ /etc/init.d/timidity start
 * Caching service dependencies ...                [ ok ]
 * Starting TiMidity++ Virtual Midi Sequencer ...  [ !! ]

This isn't really helpful, so I removed "--background" from start-stop-daemon and added it to Timidity++ itself, as Timidity supports backgrounding:

  start-stop-daemon --start --chuid timidity:nobody \                                                                                                                                             
    --make-pidfile --pidfile /var/run/timidity.pid \                                                                                                                                        
    --exec /usr/bin/timidity -- --background -iA ${TIMIDITY_OPTS}

This then gave some more helpful errors:

$ /etc/init.d/timidity start
 * Caching service dependencies ...                [ ok ]
 * Starting TiMidity++ Virtual Midi Sequencer ...
~/.timidity/current/timidity.cfg: Permission denied
timidity: Can't read any configuration file.
Please check /usr/share/timidity/timidity.cfg

Not knowing what the problem is, I made start-stop-daemon load bash instead of timidity, which revealed the problem:

$ /etc/init.d/timidity start
 * Caching service dependencies ...                                                                                                                                                               [ ok ]
 * Starting TiMidity++ Virtual Midi Sequencer ...
bash: /root/.bashrc: Permission denied
$ whoami
timidity
$ ls ~
ls: cannot open directory /root: Permission denied

It looks like the config files will need to be changed, or maybe the timidity user's home directory could be corrected if that would work (which means any eselect changes made by root wouldn't work unless --global was used.)
Comment 1 Adam Nielsen 2008-01-07 09:04:06 UTC
Oops, minor correction - it seems adding "--background" doesn't always work with Timidity - changing "-iA" to "-iAD" does the trick, remembering to remove --background from start-stop-daemon.
Comment 2 Stian Skjelstad 2008-01-08 08:05:04 UTC
HOME=/root , so timitidy fails to load the root user config, so then it should revert to system default.
Comment 3 Jozef Siska 2008-06-07 12:52:05 UTC
(In reply to comment #2)
> HOME=/root , so timitidy fails to load the root user config, so then it should
> revert to system default.
> 
I strace'd timidity and it tries the files in corect order  "current/timidity.cfg", "/usr/share/timidity/current/timidity.cfg" and ".timidity/timidity.cfg" .
Which seems to be ok according to /usr/share/timidity/timidity.cfg, except the first one in the current dir.
The main problem is, that when timidity gets an ENOENT (file not found), it tries the others, but when it gets EACCES (permission denied) it just aborts.
Which means that if it is run as timidity:nobody from /root, it stops on the first file. Adding --chdir /  to start-stop-daemon in /etc/init.d/timidity helps ;)

Another problem for me was, that even when timidity user has audio as base group, timidity could not access /dev/snd/*, (seems due to the way start-stop-daemon changes the user/group) so i also changed timidity:nobody to timidity:audio
Comment 4 Jeremy Murphy 2008-10-10 09:06:37 UTC
<bump> Any progress being made on this?
Comment 5 Daniel Nilsson 2008-12-06 19:47:58 UTC
The broken version of timidity++ has now been marked stable on amd64 so I have been hit by this issue too.
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2008-12-07 00:08:40 UTC
Flameeyes, IIRC, you made the init script changes and are familiar with them. Can you sort this out? The version is going stable and others are leaving the tree with Portaudio v18.
Comment 7 Fabio Bonfante 2008-12-23 14:21:27 UTC
regarding the /etc/timidity.cfg i see no reason to have "dir ~/.timidity" enabled by default. The eselect timidity already create the current symlink in /usr/share/timidity. So if the preferred way for start timidity is from the init script there's no reason to have a redundant symlink created in /root (that can even raise permission problems like just happened)

IMHO will be a cleaner solution comment that line (with a little explanation, why not?) so the user really interested to override the default behavior (and knowing what he's doing) can do the choice.
Comment 8 Doug Esanbock 2009-01-05 07:49:59 UTC
in my case this was resolved by changing --chuid timidity:nobody to --chuid timidity:audio in /etc/init.d/timidity
Comment 9 Jeremy Murphy 2009-01-05 13:47:52 UTC
I've changed my initscript to "timidity:audio" and it seems to work too.
Comment 10 Conrad Kostecki gentoo-dev 2009-01-07 00:36:14 UTC
Changing to "timidity:audio" worked for me too!
Comment 11 Maciej Mrozowski gentoo-dev 2009-03-24 01:16:17 UTC
Confirmed here as well
Comment 12 Ray 2009-03-27 12:34:38 UTC
I got version 2.13.2-r7 and the same error yet none of the above suggested works. Even chmoding the files with a+rwx doesnt solve the problem
Comment 13 Martin Gramatke 2009-03-27 20:52:01 UTC
root:audio needed here :-(
Comment 14 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2009-04-01 19:32:26 UTC
start-stop-daemon --start --background --chdir /usr/share/timidity --chuid timidity:audio --make-pidfile --pidfile /var/run/timidity.pid --exec /usr/bin/timidity -- -iA 


Try this...
Comment 15 Leung Ki Chi 2009-04-07 00:20:43 UTC
(In reply to comment #14)
> start-stop-daemon --start --background --chdir /usr/share/timidity --chuid
> timidity:audio --make-pidfile --pidfile /var/run/timidity.pid --exec
> /usr/bin/timidity -- -iA 
> 
> 
> Try this...
> 

works for me.
Comment 16 Chris Paras 2009-04-14 22:52:49 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > start-stop-daemon --start --background --chdir /usr/share/timidity --chuid
> > timidity:audio --make-pidfile --pidfile /var/run/timidity.pid --exec
> > /usr/bin/timidity -- -iA 
> > 
> > 
> > Try this...
> > 
> 
> works for me.
> 

Will this go into portage sometime ?
Comment 17 Samuli Suominen (RETIRED) gentoo-dev 2009-05-12 15:17:52 UTC
I've added -r8 with these changes in last comments.
Comment 18 Samuli Suominen (RETIRED) gentoo-dev 2009-05-12 15:20:13 UTC
*** Bug 203092 has been marked as a duplicate of this bug. ***
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2009-05-12 15:44:31 UTC
*** Bug 256233 has been marked as a duplicate of this bug. ***