Official Mumble VoIP Forums

[LINUX] murmur Startscript

Ice/DBus, Web-Interfaces, Management tools
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 systems

place it under /etc/init.d/murmurd - make sure you have executable rights

chmod 755 /etc/init.d/murmurd

it 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 information

you need only to edit the configuration part:

Code: Select all

################ 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:

Code: Select all

#! /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 Germany

Lux
I'm getting the following when attemping to use this on Centos 5.4

Code: Select all

/etc/init.d/murmurd: line 68: pidof: command not found
How can I fix this?
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:

Code: Select all

MURMUR_DAEMON_START=1
MURMUR_USE_CAPABILITIES=0
This 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.
jesepi wrote:I'm getting the following when attemping to use this on Centos 5.4

Code: Select all

/etc/init.d/murmurd: line 68: pidof: command not found
How can I fix this?
Hi!

try to replace

Code: Select all

if [ $(pidof $BIN) ]
with

Code: Select all

if [ $(/sbin/pidof $BIN) ]
in my Script - must replace 3 times

seems to be CentOS specific - google say: "pidof" command is located in "/sbin" and default PATH for centos doesn't include "/sbin" as its path

good luck! ;)