#1  
Old 22nd April 2006, 15:37
ColdDoT ColdDoT is offline
Senior Member
 
Join Date: Jan 2006
Location: Netherland
Posts: 178
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ColdDoT
Default Start stop script debian

Hello

i've got a little program that start a toc server (it is a sh script);
in it stands
Code:
#! /bin/sh

#Additional arguments for the Server

prefix="TOCserver"
args=" server OBJ-Anvil.to2?AdminName=colddot?AdminPassword=xxxxxxx -ini=../TOCrossfire/Conf/$prefix.ini userini=../TOCross
fire/Conf/$prefix.user.ini log=../TOCrossfire/Log/$prefix.log -nohomedir"


arch=`uname -m`

if [ $arch = "i686" ]; then
        bin="ucc-bin"
elif [ $arch = "x86_64" ]; then
        bin="ucc-bin-linux-amd64"
elif [ $arch = "Power Macintosh" ]; then
        bin="ucc-bin-macosx"
else
        echo "Your system is not supported !"
        exit 0
fi

while [ true ]; do

        cd /var/server/ut/public/System
        ./$bin $args
        sleep 5

done
now what i want to do is making a nicly init.d script
but i want no output from the program it self
so i have maded this
Code:
#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/toc
NAME=toc
DESC="tactical ops crossfire"

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet -m -b --pidfile /var/run/$NAME.pid \
                --exec $DAEMON
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /var/run/$NAME.pid --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                /var/run/$NAME.pid --exec $DAEMON
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac
the starting works fine but the shutdown it don't work.
is there a solution on this?

greets kevin
__________________
2B or not 2B (a pro)

Last edited by ColdDoT; 15th May 2006 at 16:36.
Reply With Quote
Sponsored Links
  #2  
Old 22nd April 2006, 16:25
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Have a look at the stop section of the /etc/init.d/mydns script on http://www.howtoforge.com/mydns_name_server. But this will only work for stopping one process. If multiple processes are running at the same time, it doesn't work.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 22nd April 2006, 22:19
ColdDoT ColdDoT is offline
Senior Member
 
Join Date: Jan 2006
Location: Netherland
Posts: 178
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ColdDoT
Default

i've made a php script who change my /etc/init.d/toc file if it startsup giving the good kill pid id's

thx greets(do you mind that i posted a expension on you munit and monit tut)
__________________
2B or not 2B (a pro)
Reply With Quote
  #4  
Old 23rd April 2006, 19:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
 
Default

Quote:
Originally Posted by ColdDoT
(do you mind that i posted a expension on you munit and monit tut)
No, not at all.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto start script linuxuser1 Desktop Operation 7 23rd May 2009 14:12
The Perfect Setup - Debian Woody (3.0)... sending mail from my XP box? ExCIA HOWTO-Related Questions 17 27th June 2007 19:31
Can not start saslauthd - Debian server Hans Server Operation 7 25th March 2007 21:43
Bind-Chroot-Howto (Debian) spaz HOWTO-Related Questions 5 9th March 2006 15:50
e-mail problem!!! Debian 3.1 maroonworks Installation/Configuration 18 6th December 2005 15:42


All times are GMT +2. The time now is 04:13.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.