Laurence Hardwick
2003-11-25, 05:14
On
> Sent: 25 November 2003 00:24
Dean said
> That would be great!> >>
Here you go
The script is called slimp3 in /etc/init.d
and accepts start and stop commands as arguments. This is then
hard linked to S99slimp3 in /etc/rc2.d that causes the server
to start and stop gracefully when solaris starts and stops.
In my system /space/slimp3 is a soft link to the current 'prefered'
directory for an installed (i.e. unpacked tar file) version of
the server.
I find I can go back and forward through versions just by changing
the soft link. I also keep version of my prefs file in case there
is ever an incompatible syntax of the prefs file that would prevent going
backwards.
$more /etc/init.d/slimp3
#!/bin/sh
# remember to change locations for
# prefs file and log files
case $1 in
'start')
pidlist=`/usr/bin/ps -ef`
PID=`echo "$pidlist" | grep slimp3.pl |awk '{print $2}'`
if [ ! -z "$PID" ] ; then
echo 'slipm3 already running'
exit
fi
/space/slimp3/slimp3.pl --daemon --logfile
/space/slimp3/log --prefsfile /export/home/slimp3/.slimp3.pref
;;
'stop')
pidlist=`/usr/bin/ps -ef`
PID=`echo "$pidlist" | grep slimp3.pl |awk '{print $2}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill -KILL ${PID}
fi
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
################################################## ########
$ ls -l slimp3
Execute by all, write by root only.
-rwxr-xr-x 2 root other 545 Nov 11 21:11 slimp3
################################################## ########
Hard link to rc2.d
$ ln /etc/init.d/slimp3 /etc/rc2.d/S99slimp3
################################################## ########
Manual stop and start
$/etc/init.d/slimp3 stop
$/etc/init.d/slimp3 start
################################################## ########
This all works on solaris 5.6
> Sent: 25 November 2003 00:24
Dean said
> That would be great!> >>
Here you go
The script is called slimp3 in /etc/init.d
and accepts start and stop commands as arguments. This is then
hard linked to S99slimp3 in /etc/rc2.d that causes the server
to start and stop gracefully when solaris starts and stops.
In my system /space/slimp3 is a soft link to the current 'prefered'
directory for an installed (i.e. unpacked tar file) version of
the server.
I find I can go back and forward through versions just by changing
the soft link. I also keep version of my prefs file in case there
is ever an incompatible syntax of the prefs file that would prevent going
backwards.
$more /etc/init.d/slimp3
#!/bin/sh
# remember to change locations for
# prefs file and log files
case $1 in
'start')
pidlist=`/usr/bin/ps -ef`
PID=`echo "$pidlist" | grep slimp3.pl |awk '{print $2}'`
if [ ! -z "$PID" ] ; then
echo 'slipm3 already running'
exit
fi
/space/slimp3/slimp3.pl --daemon --logfile
/space/slimp3/log --prefsfile /export/home/slimp3/.slimp3.pref
;;
'stop')
pidlist=`/usr/bin/ps -ef`
PID=`echo "$pidlist" | grep slimp3.pl |awk '{print $2}'`
if [ ! -z "$PID" ] ; then
/usr/bin/kill -KILL ${PID}
fi
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
################################################## ########
$ ls -l slimp3
Execute by all, write by root only.
-rwxr-xr-x 2 root other 545 Nov 11 21:11 slimp3
################################################## ########
Hard link to rc2.d
$ ln /etc/init.d/slimp3 /etc/rc2.d/S99slimp3
################################################## ########
Manual stop and start
$/etc/init.d/slimp3 stop
$/etc/init.d/slimp3 start
################################################## ########
This all works on solaris 5.6