Hi! I was making a .spec for Redhat 7.2 and also made a init script. The script was made using Redhat 7.2 functions and aware of a /etc/sysconfig/kannel conf file and chkconfg.
In the spec file a also made 5 diferent RPMs kannel , kannel-mysql , kannel-manual and kannel-contrib for i386 and kannel-src with the libxml2 patch and the init script. I made diffrent packages because of the size. 683585 kannel-1.1.6-1.i386.rpm 22936 kannel-contrib-1.1.6-1.i386.rpm 3760286 kannel-manual-1.1.6-1.i386.rpm 682709 kannel-mysql-1.1.6-1.i386.rpm 2065668 kannel-1.1.6-1.src.rpm I also made a Sparc8 pkg. I'm including the init script.You just need to create "/etc/sysconfig/kannel" with : BBCONFIG=/usr/local/etc/kannel.conf WAPCONFIG=/usr/local/etc/kannel.conf SMSCONFIG=/usr/local/etc/kannel.conf BBOPTIONS="$BBCONFIG" WAPOPTIONS="$WAPCONFIG" SMSOPTIONS="$SMSCONFIG" RUN_WAP="YES" RUN_SMS="NO" or edit the init script. José Borges Ferreira On Tue, 2002-04-30 at 16:08, Oded Arbel wrote: > Attached is my almost final version of an init script for Kannel. it > works on Mandrake and RedHat, but as it only depends on BASH, it should > work anywhere where there's BASH 2 or greater. > > How to use it - and modify the configuration at the top of the file > (wapbox is commented out, so be sure to uncomment it if you want it). > programs are listed in the order they are invoked at start, and are > stopped at the reverse order. > call the script with 'start' to start all the programs, with 'stop' to > stop all the programs and with 'status' to see if the programs are up or > down. > If a program crashes for any reason, the script will restart it > automaticly, but in case of major trouble (the runner functions crashing > too, for example. not that I can imagine why that would happen), I > suggest running a cron job which calls the script with the parameter > 'check' that will cause the script to check the status of the programs > and restart everything if needed. > > This script is chkconfig ready. > > Enjoy. > > -- > Oded Arbel > m-Wise Inc. > [EMAIL PROTECTED] > (972)-67-340014 > (972)-9-9581711 (ext: 116) > > ::.. > "Guns are made to be shot not thrown" > --from 'Harley Davidson and the Marlboro Man' > > > > -----Original Message----- > > From: Steve Rapaport [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, April 30, 2002 4:50 PM > > To: [EMAIL PROTECTED] > > Subject: Re: How to shutdown & restart Gateway development > > release 1.1.6 > > > > > > > > > > ---------- Forwarded Message ---------- > > Subject: Re: How to shutdown & restart Gateway development > > release 1.1.6 > > Date: Tue, 30 Apr 2002 16:49:21 +0200 > > From: Steve Rapaport <[EMAIL PROTECTED]> > > To: "Cipher Strength" <[EMAIL PROTECTED]> > > > > > > >What is the better way to shutdown kannel. I have compiled > > it with --enable > > >start-stop deamon it works on my testing machine but on > > production server > > >kannel not stopped.(ppl already repoting bug) > > > > > >Also if i restart kannel by killing bearerbox smsbox > > automatically kills. so > > >is it right how it should be done > > > > I second, third, and fourth that question! > > > > I also note that Oded is working on a script to work > > around the problem, but nobody seems to be working > > on finding the bug or fixing it. What gives? > > > > > > Steve Rapaport. > > > > ------------------------------------------------------- > > > > -- "Contrary to popular belief, penguins are not the salvation of modern technology. Neither do they throw parties for the urban proletariat."
#!/bin/sh # Start/stop the Kannel boxes: One bearer box and one WAP box. # chkconfig: - 86 16 # description: Kannel is an Open Source SMS/WAP gateway. WAP is short for Wireless Application\ # Protocol. It lets the phone act as a simple hypertext browser, but optimizes the\ # markup language, scripting language, and the transmission protocols for wireless\ # use. The optimized protocols are translated to normal Internet protocols by a WAP\ # gateway. Kannel also works as a SMS gateway for GSM networks. Almost all GSM\ # phones can send and receive SMS messages, so this is a way to serve many more\ # clients than just those using WAP phones. # processname: kannel # config: /etc/sysconfig/kannel # This is the default init.d script for Kannel. Its configuration is # appropriate for a small site running Kannel on one machine. # Make sure that the Kannel binaries can be found in $BOXPATH or somewhere # else along $PATH. run_kannel_box has to be in $BOXPATH. BBCONFIG=/usr/local/etc/kannel.conf WAPCONFIG=/usr/local/etc/kannel.conf SMSCONFIG=/usr/local/etc/kannel.conf BBOPTIONS="$BBCONFIG" WAPOPTIONS="$WAPCONFIG" SMSOPTIONS="$SMSCONFIG" RUN_WAP="YES" RUN_SMS="YES" # Source function library. . /etc/init.d/functions # Get config. . /etc/sysconfig/network if [ -f /etc/sysconfig/kannel ];then . /etc/sysconfig/kannel fi # Check that networking is up. if [ "$NETWORKING" = "no" ] then exit 0 fi RETVAL=0 startprog () { prog=$1 echo -n "Starting $prog : " $prog $OPTIONS 2> /dev/null & RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog [ $RETVAL -eq 0 ] && echo_success [ $RETVAL -ne 0 ] && echo_failure echo } stopprog () { prog=$1 echo -n "Stopping $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog } startall () { OPTIONS=$BBOPTIONS && startprog "bearerbox" [ $RUN_WAP == "YES" ] && OPTIONS=$WAPOPTIONS && startprog "wapbox" [ $RUN_SMS == "YES" ] && OPTIONS=$SMSOPTIONS && startprog "smsbox" } stopall () { stopprog wapbox stopprog smsbox stopprog bearerbox } # See how we were called. case "$1" in start) startall ;; stop) stopall ;; status) status bearerbox status wapbox status smsbox ;; restart|reload) stopall startall ;; condrestart) [ -f /var/lock/subsys/$prog ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" exit 1 esac exit $?