I've been looking into some of the problems with /etc/init.d/slimserver
on Fedora Core5, and I don't think it's the script after all.

If I do the following on FC5:

1) su - slimserver

2) Start SlimServer the same way /etc/init.d/slimserver would:

/usr/local/slimserver/slimserver.pl --daemon
--prefsfile=/etc/slimserver.conf --logfile=/tmp/slimserver.log

Now, when I do a ps aux | grep slimserver, I get:

502      26967 32.3  2.1  48476 43756 ?        Ss   09:42   0:00
slimserver
502      26969  0.0  0.0   1644   488 ?        Ss   09:42   0:00
/usr/local/slimserver/Bin/i386-linux/mDNSResponderPosix -d -f
/usr/local/slimserver/mDNS.conf -P /usr/local/slimserver/mDNS.pid

I'm not sure what the second process is (26969), however the first
process is the problem: This isn't "slimserver.pl" or, better yet,
"/usr/local/slimserver/slimserver.pl".  Instead, it's just
"slimserver".

As a result, the routines in /etc/rc.d/init.d/functions fail to be able
to find the process, which is what /etc/init.d/slimserver expects.

The behavior within SlimServer changes if started without the --daemon
qualifier.  I think the process name is just being set wrong with the
--daemon qualifier, and that's why the startup script is ill behaved.

I see two ways to resolve this:

1. Fix the --daemon qualifier to set the process name to
/usr/local/slimserver/slimserver.pl, as the startup scripts expect,
or,

2. Fix the startup script to use PID files rather than process name to
find running instances.

I think I found it.  In slimserver.pl, in sub daemonize, I see:

# Bug: 1625 - There appears to be a bad interaction with the
iTunes
# Update plugin / Mac::Applescript::Glue , and setting the
process
# name after we fork. So don't do it on Mac. The System
Preferences
# start/stop still works.

if (Slim::Utils::OSDetect::OS() ne 'mac') {
$0 = "slimserver";
}

I think that's it ... lemme check.

Bingo.  If I change that line to:

$0 = "/usr/local/slimserver/slimserver.pl"

then everything works.

So, this is obviously a hack.  The proper way to deal with this would
be to get the directory from the configuration and set the process name
based on that.  But I'm unsure how this would effect other platforms.

Better off fixing slimserver.pl to set the process name correctly (i.e.
"<install-dir>/slimserver.pl", or better off fixing
/etc/init.d/slimserver to use PID files rather than requiring the
correct process name?

Thoughts/suggestions?  Thanks!

-- Jeff


-- 
Jeff
------------------------------------------------------------------------
Jeff's Profile: http://forums.slimdevices.com/member.php?userid=49
View this thread: http://forums.slimdevices.com/showthread.php?t=23258

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix

Reply via email to