Re: automatic starting GnuGK with Linux system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I can't understand your difficulties. If you can start ANY programm as daemon 
on your system, there are no problems to start GNUGKD daemon on your Linux 
and place link to gnugkd script to starting runlevel directory. If you can't, 
learn HOWTO.

This is my  daemon script (you can use this script as base for your needs or 
choose other gk.initd.* script):
#!/bin/sh
#
# gnugkd (based on gk.initd.redhat)
# gnugk         This shell script takes care of starting and stopping \
#               gnugk (Openh323 Gatekeeper - GNU Gatekeeper daemon)
#
# chkconfig: 345 92 60
# description: The GNU Gatekeeper, a full featured H.323 gatekeeper
# processname: /usr/sbin/gnugk
# config: /etc/gnugk.ini
#
# Maintained by Chih-Wei Huang <cwhuang@xxxxxxxxxxxx>
#               Citron Network Inc.
#

# Source function library.
. /etc/rc.d/init.d/functions

GKEXE=/opt/openh323/gnugk
GKPID=/var/run/gnugk.pid
GKCONFIG=/etc/gnugk/gnugk.ini
LOGFILE=/var/log/gnugk/gnugk.log
LOCKFILE=/var/lock/subsys/gnugk
GKUSER=kompnet

# Source networking configuration and check that networking is up.
if [ -f /etc/sysconfig/network ] ; then
        . /etc/sysconfig/network
        [ ${NETWORKING} = "no" ] && exit 0
fi

[ -x $GKEXE ] || exit 0

[ -f $GKCONFIG ] || exit 0

prog=gnugk

#RETVAL=0
start () {
    [ -f $LOGFILE ] && /usr/sbin/logrotate /etc/gnugk/gnugk_logrotate.conf  
# I am using system logrotate, not a gnugk logrotate mechanism 
    echo -n $"Starting $prog: "
    # start daemon
    nice -n -2 $GKEXE -c $GKCONFIG -o $LOGFILE -tttttt \
# nice - for changing priority of gnugk process
        > /var/log/gnugk/gnugk.start     2>&1 &
# All messages during daemon starting writes to gnugk.start file
# and I can see what's goes wrong

    RETVAL=$?
    [ $RETVAL = 0 ] && touch $LOCKFILE && success
    echo
    return $RETVAL
}

stop () {
    # stop daemon
    echo -n $"Stopping $prog: "
    killproc $GKEXE
    RETVAL=$?
    echo
    rm -f $LOCKFILE $GKCONFIG-* # delete it anyway
    return $RETVAL
}

restart () {
    stop
    start
    RETVAL=$?
    return $RETVAL
}

# See how we were called.
case "$1" in
    start)
        [ -f $LOCKFILE ] || start
        sleep 15
        ;;
    stop)
        stop
        ;;
    status)
        status $GKEXE
        RETVAL=$?
        ;;
    restart)
        restart
        ;;
    reload)
        kill -HUP `cat $GKPID`
        RETVAL=$?
        ;;
    condrestart)
        # only restart if it is already running
        [ -f $LOCKFILE ] && restart || :
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
        RETVAL=1
esac

exit $RETVAL
# End of gnugkd script

Regards,
Igor Prokhorov


On 22 Август 2005 14:03, smy@xxxxxxxx wrote:
> I had (and still having) the same problem.  I moved my exports from
> /root/.bash_profile => /etc/profile..... Yet it still didn't work.  From
> the
> looks of it, it seems like gnugk can't load the openh323 and pwlib librarie
> s
> from the export list.
>
> /etc/export should be loaded prior to all rc.x scripts...  thus placing
> openh323
> and pwlib into /etc/export should have been loaded by the time it reaches
> rc.local or simply a rc.x/Sxxgnugk script.
>
> If anyone our there is capable of make gnugk run at boot time in any manner
> ,
> please share with us!
>
> Thanks!
>
> Quoting brothaluca <brothaluca@xxxxxxxxx>:
> > Jiе≥ц╜ Gubц╜k napisaе┌(a):
> >> Check /var/lock/subsys/gnugk file. If this file is present gnugk
> >> will not start. Just delete it. Include this chceck in your rc.local
> >> file.
> >> Jiri
> >
> > I have no such diretory in my debian system; I searched for lock file
> > for gnugk and couldn't find;
> >
> >> kompnet napsal(a):
> >>> To start gnugk as system daemon you need to use one of gk.initd.* scrip
>
> ts.
>
> >>> I'm not sure but for Debian you can use gk.initd.redhat script.
> >>> Place it to your daemons-runlevel directory, edit it for your needs
> >>> and make it executable.
> >>> Enjoy!
> >
> > I did, my script is as follows:
> >
> > ----------------------------------------
> > #!/bin/sh
> >
> > GKEXE=/usr/local/bin/gnugk
> > GKPID=/var/run/gnugk.pid
> > GKCONFIG=/etc/gnugk/gnugk.ini
> > LOGFILE=/var/log/gnugk
> >
> > [ -x $GKEXE ] || exit 0
> >
> > [ -f $GKCONFIG ] || exit 0
> >
> > prog=gnugk
> >
> > RETVAL=0
> >
> > start () {
> >     [ -f $LOGFILE ] && mv -f $LOGFILE $LOGFILE.bak
> >     echo -n $"Starting $prog: "
> >     # start daemon
> >     $GKEXE -c $GKCONFIG -o $LOGFILE -tt > /dev/null 2>&1 &
> >     RETVAL=$?
> >     [ $RETVAL = 0 ]
> >     echo
> >     return $RETVAL
> > }
> >
> > stop () {
> >     # stop daemon
> >     echo -n $"Stopping $prog: "
> >     killall $GKEXE
> >     RETVAL=$?
> >     echo
> >     return $RETVAL
> > }
> >
> > restart () {
> >     stop
> >     start
> >     RETVAL=$?
> >     return $RETVAL
> > }
> >
> > # See how we were called.
> > case "$1" in
> >     start)
> >          start
> >         ;;
> >     stop)
> >         stop
> >         ;;
> >     status)
> >         status $GKEXE
> >         RETVAL=$?
> >         ;;
> >     restart)
> >         restart
> >         ;;
> >     reload)
> >         kill -HUP `cat $GKPID`
> >         RETVAL=$?
> >         ;;
> >     *)
> >         echo $"Usage: $0 {start|stop|restart|reload|status}"
> >         RETVAL=1
> > esac
> >
> > exit $RETVAL
> > -----------------------------------------------------
> >
> > I copied it to /etc/init.d/ directory, make it +x, updated rc.X links
> > (update-rc.d gnugk defaults 98)
> > and still can't get it start with system;
> > If I start/restart/stop gnugk with this script manually (invoke-rc.d
> > gnugk start/restart/stop) it works correctly, but in time system is
> > booting it doesn't;
> > As I wrote before, I added env. variables (pwlib, openh323...) to
> > /etc/profile;
> > In my logs I have nothing....
> > Maybe you know, what thing is done first while system booting:
> > invoking rc.X scripts or setting variables from /etc/profile???
> > Maybe while rc.X scrits are invoked, there are no pwlib,openh323
> > variables because /etc/profile is not yet proceeded and that is why
> > gnugk doesn't start?
> > Maybe this is the problem....
> > I have no other ideas....
> >
> > Please help
> >
> > Regards
> >
> >>>> Hi,
> >>>>
> >>>> I have following problem:
> >>>> I need to start GnuGK on my Debian box while starting operating system
>
> ;
>
> >>>> I added rc.local and pointed to script which start gk (just 1 line:
> >>>> gnugk -c /etc/gnugk.ini -tt -o /var/log/gnugk)
> >>>> I also added variables for openh323, pwlib and my database to
> >>>> /etc/profile;
> >>>> It still doesn't work;(
> >>>>
> >>>> Any suggestions?
> >>>>
> >>>> Regards
> >>>>
> >>>>
> >>>> ----------------------------------------------------------------------
> >>>> Dla kobiet i nie tylko! ;-) >>> http://link.interia.pl/f18aa
> >>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------
> >>>> SF.Net email is Sponsored by the Better Software Conference & EXPO
> >>>> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> >>>> Practices
> >>>> Agile & Plan-Driven Development * Managing Projects & Teams * Testing
>
> & QA
>
> >>>> Security * Process Improvement & Measurement * http://www.sqe.com/bsce
>
> 5sf
>
> >>>> _______________________________________________________
> >>>>
> >>>> Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
> >>>> Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
> >>>> Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-us
>
> ers
>
> >>>> Homepage: http://www.gnugk.org/
> >>>
> >>> -------------------------------------------------------
> >>> SF.Net email is Sponsored by the Better Software Conference & EXPO
> >>> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Pract
>
> ices
>
> >>> Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
>
>  QA
>
> >>> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5
>
> sf
>
> >>> _______________________________________________________
> >>>
> >>> Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
> >>> Archive: http://sourceforge.net/mailarchive/forum.php?forum_idБ■≤;
>
> 49
>
> >>> Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-use
>
> rs
>
> >>> Homepage: http://www.gnugk.org/
> >>
> >> -------------------------------------------------------
> >> SF.Net email is Sponsored by the Better Software Conference & EXPO
> >> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practi
>
> ces
>
> >> Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
>
> QA
>
> >> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5s
>
> f
>
> >> _______________________________________________________
> >>
> >> Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
> >> Archive: http://sourceforge.net/mailarchive/forum.php?forum_idО©╫4
>
> 9
>
> >> Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-user
>
> s
>
> >> Homepage: http://www.gnugk.org/
> >
> > ----------------------------------------------------------------------
> > Startuj z INTERIA.PL! >>> http://link.interia.pl/f186c
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO
> > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practic
>
> es
>
> > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & Q
>
> A
>
> > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> > _______________________________________________________
> >
> > Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
> > Archive: http://sourceforge.net/mailarchive/forum.php?forum_id?49
> > Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
> > Homepage: http://www.gnugk.org/
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________________
>
> Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
> Archive: http://sourceforge.net/mailarchive/forum.php?forum_id┘49
> Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
> Homepage: http://www.gnugk.org/



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id┘49
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/


[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux