PDA

View Full Version : Startup ventrilo servers on linux


KrisDeFou
02-24-2006, 01:21 AM
Hi, im looking to start ventrilo when the system is booted with the scripts on the ventrilo_srv.htm .

I would like to know how to use it please. I create a document with the script ? or I write it on rc.local ?

I think I need to change the name ventrilo on the script ? Im not really sure about the information on the file.

Thanks

KDF

Ethan
02-26-2006, 06:56 AM
i had the same problem when i switched my servers to Linux depending on the version of linux i use debian. you would make a file in /etc/init.d or /etc/rc.d named whatever you like. for example i used ventriloserv no file extension needed, then add a script like this.

#!/bin/sh
case "$1" in
start)
echo "Starting Ventrilo Server."
cd /pathtoventrilo/
/ventrilo_srv -d
echo "Ventrilo Server Started"
;;
stop)
echo "Shutting Down Ventrilo Server."
cd /pathofventrilo/
kill `cat ventrilo_srv.pid`
echo "Ventrilo Server Is Now Down"
;;
restart)
echo "Restarting Ventrilo Server..."
cd /pathtoventrilo/
kill `cat ventrilo_srv.pid`
/ventrilo_srv -d
echo "Ventrilo Server Restarted"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0


if you are using the pro version add -Rfilename.reg before -d

then execute this command
update-rc.d ventriloserv defaults
this will register the script in the init.d if you need to remove it the command is
update-rc.d -f ventriloserv remove

the script i made has Start Stop and Restart built in it

used like this
/etc/init.d/ventriloserv start
/etc/init.d/ventriloserv stop
/etc/init.d/ventriloserv restart

if you need any other info just ask

- Ethan

KrisDeFou
03-21-2006, 12:15 AM
Hi, thanks for the help but its not really what im looking for. I would like my ventrilo server start when the computer is booted and set it up as a system service.

Ive try the script in ventrilo_srv.htm but its not work for me. Maybe someone can look because i can make error.

# Startup ventrilo servers.
VENPATH=/home/ventrilo
VENBIN=$VENPATH/ventrilo_srv
su ventrilo -c "$VENBIN -f$VENPATH/3784 -d"
su ventrilo -c "$VENBIN -f$VENPATH/4000 -d"

renice -5 `cat $VENPATH/3784.pid`
renice -5 `cat $VENPATH/4000.pid`


mine is:

# Startup ventrilo servers.

VENPATH=/home/admin/ventrilo_srv-2.3.1
VENBIN=$VENPATH/ventrilo_srv

su admin -c "$VENBIN -f$VENPATH/3784 -d"

renice -5 `cat $VENPATH/3784.pid`


Its seem good or bad?

Thanks for the help

mekius_
06-05-2006, 07:01 PM
i had the same problem when i switched my servers to Linux depending on the version of linux i use debian. you would make a file in /etc/init.d or /etc/rc.d named whatever you like. for example i used ventriloserv no file extension needed, then add a script like this.

#!/bin/sh
case "$1" in
start)
echo "Starting Ventrilo Server."
cd /pathtoventrilo/
/ventrilo_srv -d
echo "Ventrilo Server Started"
;;
stop)
echo "Shutting Down Ventrilo Server."
cd /pathofventrilo/
kill `cat ventrilo_srv.pid`
echo "Ventrilo Server Is Now Down"
;;
restart)
echo "Restarting Ventrilo Server..."
cd /pathtoventrilo/
kill `cat ventrilo_srv.pid`
/ventrilo_srv -d
echo "Ventrilo Server Restarted"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

if you are using the pro version add -Rfilename.reg before -d

then execute this command
update-rc.d ventriloserv defaults this will register the script in the init.d if you need to remove it the command is
update-rc.d -f ventriloserv remove
the script i made has Start Stop and Restart built in it

used like this
/etc/init.d/ventriloserv start
/etc/init.d/ventriloserv stop
/etc/init.d/ventriloserv restart

if you need any other info just ask

- Ethan
Great script, works like a charm. The only issue I see is the script runs the server as root which could be dangerous. I changed the '/ventrilo_srv -d' lines to 'sudo -u <username> ./ventrilo_srv -d' command to allow it to run as another user.

zarinrs
06-14-2007, 07:35 PM
I have rewritten the startup script similar to the way MySQL works.

I think you will enjoy this script much better.

Just drop this in /etc/init.d/

Call it whatever you want... i called mine ventrilo

to start do
service ventrilo start
service ventrilo stop
service ventrilo restart
service ventrilo status




#!/bin/bash
#
# vent This shell script takes care of starting and stopping
# the Ventrilo subsystem (vent).
#
# chkconfig: - 64 36
# description: Ventrilo Chat Interface.
# processname: ventd
# config: /do_not_remove/ventrilo_srv.ini
# pidfile: /do_not_remove/ventrilo_srv.pid
# Source function library.
. /etc/rc.d/init.d/functions

# CONFIG
prog="Vent"
vent_path=/do_not_remove/vent
vent_user=ventrilo
vent_bin=$vent_path/
vent_server=ventrilo_srv
vent_log=$vent_path/ventrilo_srv.log
vent_pid=$vent_path/ventrilo_srv.pid
# Startup ventrilo servers.
start(){
chmod 0775 $vent_path
chmod 0775 $vent_log

su $vent_user -c "$vent_path/$vent_server -f$vent_path/$vent_server -d"
ret=0
if [ $ret -eq 0 ]; then
STARTTIMEOUT=30
while [ $STARTTIMEOUT -gt 0 ]; do
RESPONSE=`ls -al ventrilo_srv.pid 2>&1` && break
echo "$RESPONSE" | grep -q "root" && break
break
sleep 1
let STARTTIMEOUT=${STARTTIMEOUT}-1
done
if [ $STARTTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to start $prog Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi

return $ret
}
stop(){
VENTPID=`cat "$vent_pid" 2>/dev/null `
if [ -n "$VENTPID" ]; then
/bin/kill "$VENTPID" >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
STOPTIMEOUT=60
while [ $STOPTIMEOUT -gt 0 ]; do
/bin/kill -0 "$VENTPID" >/dev/null 2>&1 || break
sleep 1
let STOPTIMEOUT=${STOPTIMEOUT}-1
done
if [ $STOPTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to stop $prog Daemon."
ret=1
action $"Stopping $prog: " /bin/false
else
action $"Stopping $prog: " /bin/true
fi
else
action $"Stopping $prog: " /bin/false
fi
else
ret=1
action $"Stopping $prog: " /bin/false
fi
return $ret
}
restart(){
stop
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status vent
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit $?

Widescreen
06-14-2007, 09:32 PM
I have rewritten the startup script similar to the way MySQL works.

Good grief. A bit much, isn't it? :D I run my server on my Sun Blade 100 with Solaris 9 (am I the only one who runs Solaris in his house?) and my startup script is very simple:#!/bin/sh
cd /opt/Ventrilo/
./ventrilo_srv -d
I also created a ventrilo user and group specifically for the daemon and turned on setuid so that it can't run as root. If I need to kill the process:pkill ventrilo_srv
Having to manually do a restart doesn't exactly entail a huge amount of effort.pkill ventrilo_srv; /etc/rc3.d/S99ventrilo
;)

stillfallin
05-30-2008, 11:24 PM
so what do i got to do exactly

im not to smart when it comes to this

i do not have a root account and im runing linux

i start the server though shell and it works i close shell and the server closes

where do i got to put this file or what not and what do i have to do to make the ventrilo server just stay open all the time?

stillfallin
06-02-2008, 09:08 AM
ya so this would be great to know if this can be done without root user access

or some other way to keep the server open without having to have shell or telnet open

telazorn
06-27-2008, 04:53 PM
Now a good qustion Sorry i'm a little bit of a noob when it comes to this so this script when i add it to the root of my vent server witch is a remote server it will start and stop the vent software by its self or what

again i am sorry for not understanding