PDA

View Full Version : How to install on Debian?



george boer
2004-05-01, 18:04
Apologies for a dumb question, but I'm new to Linux. My network is mostly
Windows but I have a Debian box that runs as a file server, mail server, and
does automated backups. All my music is stored there and I'm hoping that it
will be my Slim server as well. And most importantly, my Squeezebox just
arrived and I want to get it working!

I dowloaded the slimserver RPM and ran alien on it to create a .deb file. I
then ran dpkg on the .deb file and received no complaints. However, no
server is running! The install created an /etc/rc.d/init.d directory (I
didn't have /etc/rc.d before), and put a script there named slimserver. If I
run that it complains that /etc/rc.d/init.d/functions doesn't exist (which
is true), that /etc/sysconfig/network doesn't exist (also true) and then it
exits with an error because the 'NETWORKING' environment variable isn't set.

Again, I'm sure that if I were more knowledgeable about Linux the answer
would jump out at me, but right now I'm stuck.

Can anyone guide me in the right direction?

Thanks,
Mike.

Werner Lane
2004-05-01, 19:17
I've created the two initscripts attached for my Debian (my server runs
Woody 3.0).

The 'slimserver-default' file has to be saved as
'/etc/default/slimserver'. the 'slimserver-init.d' as
'/etc/init.d/slimserver'

You you need to adjust the path names in both files to match your setup.

Then you have to make a symlink from whatever runlevel you start, e.g.
'ln -s ../init.d/slimserver /etc/rc2.d/S20slimserver' (for runlevel 2)

hope it helps, Werner

george boer wrote:
> Apologies for a dumb question, but I'm new to Linux. My network is
> mostly Windows but I have a Debian box that runs as a file server, mail
> server, and does automated backups. All my music is stored there and I'm
> hoping that it will be my Slim server as well. And most importantly, my
> Squeezebox just arrived and I want to get it working!
>
> I dowloaded the slimserver RPM and ran alien on it to create a .deb
> file. I then ran dpkg on the .deb file and received no complaints.
> However, no server is running! The install created an /etc/rc.d/init.d
> directory (I didn't have /etc/rc.d before), and put a script there named
> slimserver. If I run that it complains that /etc/rc.d/init.d/functions
> doesn't exist (which is true), that /etc/sysconfig/network doesn't exist
> (also true) and then it exits with an error because the 'NETWORKING'
> environment variable isn't set.
>
> Again, I'm sure that if I were more knowledgeable about Linux the answer
> would jump out at me, but right now I'm stuck.
>
> Can anyone guide me in the right direction?
>
> Thanks,
> Mike.


# Edit this to suit your setup
SLIMSERVER_USER="nobody"
SLIMSERVER_GROUP="nogroup"
SLIMSERVER_CFG="/mnt/shared/slimserver.conf"
SLIMSERVER_LOG="/var/log/slimserver.log"

#! /bin/sh
#
# slimserver Starts and stops the SlimServer
#
# Version: 1.0
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/SlimServer/slimserver.pl
NAME=slimserver
DESC="SliMP3 music server"

test -x $DAEMON || exit 0

set -e

# Source configuration parameters
.. /etc/default/slimserver

SLIMSERVER_ARGS="--daemon --pidfile=/var/run/$NAME.pid --prefsfile=$SLIMSERVER_CFG --logfile=$SLIMSERVER_LOG --user=$SLIMSERVER_USER --group=$SLIMSERVER_GROUP"


case "$1" in
start)
echo -n "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --exec $DAEMON -- $SLIMSERVER_ARGS
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
rm -f /var/run/$NAME.pid
echo "."
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
rm -f /var/run/$NAME.pid
sleep 1
start-stop-daemon --start --quiet --exec $DAEMON -- $SLIMSERVER_ARGS
echo "."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0