lux73 Posted February 14, 2010 Share Posted February 14, 2010 Hi all!i have wrote a small & basic start-stop script for murmur server under Linux - tested on Debian lenny 5.0 64bit - it should work on all other Linux systemsplace it under /etc/init.d/murmurd - make sure you have executable rightschmod 755 /etc/init.d/murmurdit has 4 basic commands:/etc/init.d/murmurd start- to start the server/etc/init.d/murmurd stop - to stop it/etc/init.d/murmurd restart - for restart/etc/init.d/murmurd status - status informationyou need only to edit the configuration part: ################ CONFIGURATION START ############################## # description DESC="murmur-Server" # running murmurd as specific user USER=murmurd # path to the working directory DIR=/srv/murmur1.2.2 # name of the config file INI=murmur.ini # binary name BIN=murmur.x86 ################ CONFIGURATION END ################################ it should be self explained... ;)here's the whole script: #! /bin/sh # # Basic Murmur Startscript by lux73 # # v1.0 13.02.2010 # # ################ CONFIGURATION START ############################## # description DESC="murmur-Server" # running murmurd as specific user USER=murmurd # path to the working directory DIR=/srv/murmur1.2.2 # name of the config file INI=murmur.ini # binary name BIN=murmur.x86 ################ CONFIGURATION END ################################ PARAMS="-ini $DIR/$INI" case "$1" in start) echo "trying to start $DESC..." if [ $(pidof $BIN) ] then echo "$DESC is ALREADY running! ABORT!" exit 1 else su $USER -c "cd $DIR; ./$BIN $PARAMS" sleep 1 echo "===> $DESC started succesfully!!" exit 0 fi ;; stop) echo "trying to stop $DESC..." if [ ! $(pidof $BIN) ] then echo "$DESC is even NOT running! ABORT!" exit 1 else kill $(pidof $BIN) sleep 1 echo "===> $DESC stopped succesfully!!" exit 0 fi ;; restart) $0 stop sleep 1 $0 start exit 0 ;; status) echo "Running Process from $DESC:" if [ ! $(pidof $BIN) ] then echo "===> no active process found! <===" exit 0 else ps -lC $BIN --no-heading fi ;; *) echo "Usage: /etc/init.d/murmurd start|stop|restart|status" exit 1 ;; esac have fun with it! :mrgreen: greetings from GermanyLux Quote http://mumble://mumble.djabber.de:16999/?version=1.2.3 Link to comment Share on other sites More sharing options...
jesepi Posted March 9, 2010 Share Posted March 9, 2010 I'm getting the following when attemping to use this on Centos 5.4 /etc/init.d/murmurd: line 68: pidof: command not found How can I fix this? Quote Link to comment Share on other sites More sharing options...
rawnar Posted March 9, 2010 Share Posted March 9, 2010 One can also use the init.d script provided in the source tar archive of mumble. In the subdirectory 'scripts' you can find the file murmur.init which can be copied to the /etc/init.d (or corresponding directory depending on your distribution). You also may need to at a file called 'mumble-server' in /etc/defaults containing the lines: MURMUR_DAEMON_START=1 MURMUR_USE_CAPABILITIES=0This script also expects the file 'mumble-server.ini' in /etc, an example of this file can also be found in the scripts subdirectory of the mumble source tar archive.Hopefully it helps. Quote Computer specs: AMD FX-8320, 8GB DDR3-SDRAM, AMD Radeon HD 7950, Asus Xonar D1, Windows 7 Ultimate 64bit/Debian Jessie AMD64. Link to comment Share on other sites More sharing options...
lux73 Posted March 11, 2010 Author Share Posted March 11, 2010 I'm getting the following when attemping to use this on Centos 5.4 /etc/init.d/murmurd: line 68: pidof: command not found How can I fix this?Hi!try to replace if [ $(pidof $BIN) ] with if [ $(/sbin/pidof $BIN) ] in my Script - must replace 3 timesseems to be CentOS specific - google say: "pidof" command is located in "/sbin" and default PATH for centos doesn't include "/sbin" as its pathgood luck! ;) Quote http://mumble://mumble.djabber.de:16999/?version=1.2.3 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.