So ask someone familiar with the particular Linux distro you use.
NOTE - the following example WILL NOT work for you, its for Slackware,
and for custom installed kannel, you HAVE to delete and change most of the 
settings

example:
r...@bubu:[Thu Jul 09 10:37:03]:[~]$ cat /etc/rc.d/rc.kannel.clickatell
#!/bin/sh

bearer="/opt/kannel/sbin/bearerbox"
smsbox="/opt/kannel/sbin/smsbox"
sqlbox="/opt/kannel/sbin/sqlbox"

bearerPID="/var/run/bearerbox.pid"
smsboxPID="/var/run/smsbox.pid"
sqlboxPID="/var/run/sqlbox.pid"

mtelconf="/opt/kannel/etc/4636/wavecom.ttyS0.smskannel.conf"
sqlconf="/opt/kannel/etc/sqlbox.conf"

logfile="/var/log/kannel/start.restart.log"
if [ -f "${mtelconf}" ]
then
        if [ ! -f "${bearerPID}" ]
        then
                commnd="${bearer} -d -P -p ${bearerPID} ${mtelconf}"
                echo "$(date) : starting bearerbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd} >> ${logfile} 2>&1
        else
                echo "$(date) : There is existing bearerbox pid file: 
${bearerPID} : [$(cat ${bearerPID})]" >> ${logfile} 2>&1
                echo "$(date) : Killing  bearerbox : [$(cat ${bearerPID})]" >> 
${logfile} 2>&1
                kill "$(cat "${bearerPID}")"
                if [ -f "${bearerPID}" ]
                then
                    rm "${bearerPID}"
                fi
                while [ "$(ps ax | grep -i "${bearer}" | grep -v "grep -i 
"${bearer}"")" != ""  ]
                do
                  kill "$(cat "${bearerPID}")"
                sleep 1
                done
                commnd="${bearer} -d -P -p ${bearerPID} ${mtelconf}"
                echo "$(date) : starting bearerbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd} >> ${logfile} 2>&1
        fi
fi

sleep 2
if [ -f "${mtelconf}" ]
then
        if [ ! -f "${smsboxPID}" ]
        then
                commnd="${smsbox} -d -P -p ${smsboxPID} ${mtelconf}"
                echo "$(date) : starting smsbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd}  >> ${logfile} 2>&1
        else
                echo "$(date) : There is existing smsbox pid file: ${smsboxPID} 
: [$(cat ${smsboxPID})]" >> ${logfile} 2>&1
                echo "$(date) : Killing  smsbox : [$(cat ${smsboxPID})]" >> 
${logfile} 2>&1
                kill "$(cat "${smsboxPID}")"
                if [ -f "${smsboxPID}" ]
                then
                    rm "${smsboxPID}"
                fi
                while [ "$(ps ax | grep -i "${smsbox}" | grep -v "grep -i 
"${smsbox}"")" != ""  ]
                do
                  kill "$(cat "${smsboxPID}")"
                sleep 1
                done
                commnd="${smsbox} -d -P -p ${smsboxPID} ${mtelconf}"
                echo "$(date) : starting smsbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd}  >> ${logfile} 2>&1
        fi
fi


if [ -f "${sqlconf}" ]
then
        if [ ! -f "${sqlboxPID}" ]
        then
                commnd="${sqlbox} -d -P -p ${sqlboxPID} ${sqlconf}"
                echo "$(date) : starting sqlbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd}  >> ${logfile} 2>&1
        else
                echo "$(date) : There is existing sqlbox pid file: ${sqlboxPID} 
: [$(cat ${sqlboxPID})]" >> ${logfile} 2>&1
                echo "$(date) : Killing  sqlbox : [$(cat ${sqlboxPID})]" >> 
${logfile} 2>&1
                kill "$(cat "${sqlboxPID}")"
                if [ -f "${sqlboxPID}" ]
                then
                    rm "${sqlboxPID}"
                fi
                while [ "$(ps ax | grep -i "${sqlbox}" | grep -v "grep -i 
"${sqlbox}"")" != ""  ]
                do
                  kill "$(cat "${sqlboxPID}")"
                sleep 1
                done
                commnd="${sqlbox} -d -P -p ${sqlboxPID} ${sqlconf}"
                echo "$(date) : starting sqlbox with command: ${commnd}" >> 
${logfile} 2>&1
                ${commnd}  >> ${logfile} 2>&1
        fi
fi



ps ax | grep -i box



FADILI Hanae wrote:
> Hi,
> 
> configue --enable-start-stop-daemon just allows kannel to start as a
> daemon independently from the terminal. But i'm searching if kannel can
> start by itself when the PC starts...
> I'm not good in linux, it's the first time i'm working with it so i
> don't know which script to use and how to use it...
> 
> Thank you for the help:)
> 
> 
> Nikos Balkanas <[email protected]> a écrit :
> 
>> Hi,
>>
>> That + you might try:
>>
>> configure --enable_start_stop_daemon
>>
>> BR,
>> Nikos
>>   ----- Original Message -----
>>   From: Alejandro Guerrieri
>>   To: FADILI Hanae
>>   Cc: [email protected]
>>   Sent: Wednesday, July 08, 2009 5:01 PM
>>   Subject: Re: how to start kannel as a deamon?
>>
>>
>>   You need an init script for that, it's not kannel's fault.
>>
>>
>>   There's some examples lying around, google a little bit for one  for
>> your particular linux distro.
>>
>>
>>   Regards,
>>
>>
>>   Alejandro
>>
>>
>>   On Wed, Jul 8, 2009 at 3:54 PM, FADILI Hanae 
>> <[email protected]> wrote:
>>
>>
>>     Thank you but I used it. it just started kannel as a deamon 
>> independatly from a terminal.
>>     I want to know if there is a solution that makes kannel start 
>> directly when the pc starts, without a command line?
>>
>>     Alejandro Guerrieri <[email protected]> a écrit :
>>
>>
>>
>>       --daemonize rings any bells? ;)
>>       Please read the userguide again and check that part.
>>
>>       Regards,
>>
>>       Alejandro
>>
>>       On Wed, Jul 8, 2009 at 3:31 PM, FADILI Hanae  
>> <[email protected]>wrote:
>>
>>
>>         Hi,
>>
>>         I've instaled kannel (bearerbox+wapbox). It works well as a 
>> wap proxy. but
>>         i have to start it with the command lines
>>         ./usr/local/sbin/bearerbox kannel.conf
>>         .:usr/local/sbin/wapbox kannel.conf
>>
>>         I want to know if there is a solution to start kannel as a 
>> deamon? I need
>>         it o start when I start the PC? is it possible?
>>
>>         I read the user guide but i didn't really understand.
>>
>>         Regards
>>
>>         ----------------------------------------------------------------
>>         This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>     ----------------------------------------------------------------
>>     This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>>
> 
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> 
> 
> 

Reply via email to