tirsdag den 14. august 2007

Instructions for installing Slimserver Ubuntu (Debian)

/* install as su */
sudo su

/* setup slimserver user */
addgroup slimserver
adduser --ingroup slimserver slimserver

/* unpack slimserver code */
cd /usr/local
tar -xzvf ....SlimServer_v2005-08-02.tar.gz
ln -s SlimServer_v2005-08-0 slimserver (link or rename directory as required)
chown -Rf slimserver:slimserver /usr/local/slimserver

/* create pref file with write permissions for slimserver */
nano /etc/slimserver.pref
(save as empty file)
chmod 666 /etc/slimserver.pref

/* create startup script */
nano /etc/init.d/slimserver
cut & paste:

#!/bin/sh

# slimserver init script for Debian Linux
#
# This script expects slimserver to be installed in
# /usr/local/slimserver
#
# logfile will be written to
# /tmp/slimserver.log
#

DAEMON=/usr/local/slimserver/slimserver.pl
PIDFILE=/var/tmp/slimserver.pid
LOGFILE=/tmp/slimserver.log
USER=slimserver
SLIMSERVER_OPTS=""

test -x ${DAEMON} || exit 0

case "$1" in
start) echo -n "Starting Slimserver: "
HOME=/home/$USER
start-stop-daemon --start --quiet --exec $DAEMON \
--chuid ${USER} -- --daemon \
--prefsfile=/etc/slimserver.pref --pidfile=${PIDFILE} \
--logfile=${LOGFILE} ${SLIMSERVER_OPTS}
echo "slimserver"
;;

stop) echo -n "Stopping Slimserver: "
start-stop-daemon --stop --quiet --user ${USER} --pidfile ${PIDFILE} --retry 5
echo "done"
;;

force-reload|restart) $0 stop
$0 start
;;

*) echo "Usage: $0 {start|stop|restart|force-reload}"
exit 1;
;;

esac

exit 0

(save file)
chmod chmod 755 /etc/init.d/slimserver

/* start slimserver */
/etc/init.d/slimserver start

/* add to init */
update-rc.d slimserver defaults

/* kill su */
exit

Ingen kommentarer:

Blog-arkiv