My script is sort of lame, but here goes. First, I don't use the deb
package - presumably it has its own stop/start/etc scripts. I use the
tarball.

It runs out of cron:


Code:
--------------------
    @reboot /export/home/slim/watch-squeezebox-server > /dev/null 2>&1 &
--------------------


It needs some /etc/sudoers sauce:


Code:
--------------------
    Cmnd_Alias  PROC_MGMT = /usr/bin/renice
  slim ALL = NOPASSWD: PROC_MGMT
--------------------


here's the script:


Code:
--------------------
    #!/bin/sh
  
  #for reduced cron environment
  PATH=$perl:/usr/bin:/bin:/usr/local/lame/bin:/export/home/jth/tools
  export PATH
  
  perl=/export/home/slim/perl5100/bin
  slimdir=/export/home/slim/server
  slimlog=/export/home/slim/log/server.log
  squeezecenter=$slimdir/slimserver.pl
  sudo renice -5 $$
  
  while true ; do
  cd $slimdir
  echo `date`" squeezebox server starting" >> $slimlog
  $perl/perl $squeezecenter >> $slimlog 2>&1
  retval=$?
  echo "squeezebox server ended with retval $retval" | \
  logger -t SLIMSERVER -p daemon.err
  sleep 15
  done
--------------------


The end result is the server runs at increased priority -5. I have the
server start in a loop because in the early days, the server would
crash
occasionally and this would automatically restart it. I can't remember
the last time the server has crashed though.

Hope it helps...


-- 
jth
------------------------------------------------------------------------
jth's Profile: http://forums.slimdevices.com/member.php?userid=48
View this thread: http://forums.slimdevices.com/showthread.php?t=74466

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

Reply via email to