Murmur Init Scripts
From Mumble
(Redirected from Murmur Init Script)
Contents |
Linux/SysV Single Server
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Murmur Service
# Idologic Jun 27, 2007
# Get function from functions library
. /etc/init.d/functions
# Start the service Murmur
start() {
echo -n $"Starting Murmur server: "
daemon /usr/sbin/murmur -ini /etc/murmur/murmur.ini
### Creating the lock file ###
touch /var/lock/subsys/murmur
success $"Murmur server startup"
echo
}
# Restart the service Murmur
stop() {
echo -n $"Stopping Murmur server: "
killproc murmur
### Deleting the lock file ###
rm -f /var/lock/subsys/murmur
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status murmur
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Linux/SysV Multiple Servers
In order to setup multiple serves we will have to create aditional sqlite databases and configuration files for the settings each server will run at. No 2 or more servers can bind to the same port, it is very important to make sure you do not use the same port twice!
In the configuration ini file, we will need to change the port which Murmur binds.
# Port to bind TCP and UDP sockets to port=64738
Set the above line in your config file to a port that is not being used by other services. (ie: port=64739) Next we will need to create multiple init scripts to start up each server.
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Murmur Service 1
# Idologic Jun 27, 2007
# Get function from functions library
. /etc/init.d/functions
# Start the service Murmur
start() {
echo -n $"Starting Murmur server 1: "
daemon /usr/sbin/murmur -ini /etc/murmur/murmur1.ini
### Creating the lock file ###
touch /var/lock/subsys/murmur1
success $"Murmur server 1 startup"
echo
}
# Restart the service Murmur
stop() {
echo -n $"Stopping Murmur server 1: "
killproc murmur1
### Deleting the lock file ###
rm -f /var/lock/subsys/murmur1
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status murmur
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Now the init script for the second server
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Murmur Service 2
# Idologic Jun 27, 2007
# Get function from functions library
. /etc/init.d/functions
# Start the service Murmur
start() {
echo -n $"Starting Murmur server 2: "
daemon /usr/sbin/murmur -ini /etc/murmur/murmur2.ini
### Creating the lock file ###
touch /var/lock/subsys/murmur2
success $"Murmur server 2 startup"
echo
}
# Restart the service Murmur
stop() {
echo -n $"Stopping Murmur server 2: "
killproc murmur2
### Deleting the lock file ###
rm -f /var/lock/subsys/murmur2
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status murmur2
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Debian based
If you use a Debian based GNU/Linux you should use the Murmur_Init_Script(Debian)

