Bug 76 - add gentoo instructions (see note)
: add gentoo instructions (see note)
Status: RESOLVED WONTFIX
Product: Logitech Media Server
Classification: Unclassified
Component: RPM
: unspecified
: Other Linux (other)
: P2 enhancement (vote)
: Future
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-19 21:52 UTC by Blackketter Dean
Modified: 2011-03-16 04:39 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blackketter Dean 2003-12-19 21:52:43 UTC
Untar the SliMP3 tarball with tar -C /install/dir -zxvf SliMP3_Server_v3.0.tar.gz

Gentoo is a little different w.r.t startup scripts. 
The script itself sits in /etc/init.d as expected and takes the following form...

#!/sbin/runscript

start()
{
        ebegin "starting SliMP3 Server"
        /home/andyf/SliMP3_Server_v3.0/slimp3.pl --mp3dir /mp3 --daemon
        eend $? "Failed to start SliMP3 server"
}

The 'runscript' script is the interpreter
The start() function runs perfectly and will start the server as expected.
Unfortunately the stop script does not work as when the server is started, it doesn't write the pid to 
a .pid file in /var/run, therefore, as mentioned, the following will not work.

stop()
{
        ebegin "Stopping SliMP3 Server"
        kill $(cat /var/run/slim.pid)
        eend $? "Failed to stop SliMP3 Server"
}


I tried another method (just in case anyone else responds with this solution for Gentoo). There is a 
script that will write the pid to the file for you with the following

start() 
{ 
        ebegin "Starting SliMP3 Server" 
        start-stop-daemon --start --quiet -make-pidfile /var/run/slim.pid --pidfile /var/run/
slim.pid --sta
rtas /opt/SliMP3_Server_v3.0/slimp3.pl -- --mp3dir /mp3 --daemon
        eend $? "Failed to start SLiMP3 Server" 
}

Unfortunately, it seems the SliMP3 server forks after execution and the pid is incorrect (actually it's 
the pid -1) i.e

andy@home# ps -ef | grep slim
root      4274     1  2 16:35 ?        00:00:37 /usr/bin/perl -w /opt/SliMP3_Server_v3.0/slimp3.pl /
var/run/slim.pid --mp3dir /mp3 --daemon

andy@home# cat /var/run/slim.pid
4273

Anyway if you use the first start() function mentioned above it will start fine.
Once the script is in /etc/init.d the symbolic link is required from one of the run levels.
Three run levels exist by default (although you can create as many as you like!!) namely "boot", 
"default" and "nonetwork"
By running rc-update add /etc/init.d/script_name default, the symbolic link will be made from the 
default run level.

Here is my default run level...
andy@home# ls -l /etc/runlevels/default/
total 0
lrwxrwxrwx    1 root     root           17 Dec 12 11:27 *cron -> /etc/init.d/vcron
lrwxrwxrwx    1 root     root           18 Jan 12 09:22 SliMP3 -> /etc/init.d/SliMP3
lrwxrwxrwx    1 root     root           17 Dec 11 23:08 local -> /etc/init.d/local
lrwxrwxrwx    1 root     root           20 Dec 12 11:35 net.eth0 -> /etc/init.d/net.eth0
lrwxrwxrwx    1 root     root           20 Dec 11 23:08 netmount -> /etc/init.d/netmount

If you guys managed to check the Linux distro before running slimp3.pl, you could write out the 
pid in /var/run/slimp3.pid so the stop() script will work as well (just a suggestion!!  ;-) )

Anyway, hope this helps

Andy
Comment 1 Blackketter Dean 2005-06-07 11:10:00 UTC
Moving bugs that won't be immediately fixed in 6.1 release. Please review and update if this is an error 
or if this bug has already been fixed.  Thanks.