Hi Gurus I am trying to make asterisk load as a linux servics at boot time. I tried both methods; (a) /etc/init.d/asterisk (b) /etc/rc.d/rc.local But * failed to start. What is interesting is the message log (attached below), in either case problem is with chan_h323.so. Which is failing to load. Once the box is booted up I can start * no problems, I can run same asterisk script I used in (a) above and have no problems. Chan_h323 has no complains. So, what could be the difference at boot-time and when I manually run the same script later on ? Here is the log; Dec 23 23:33:50 WARNING[1074494176]: File cdr_addon_mysql.c, Line 258 (my_load_module): MySQL database sock file not specified. Using default Dec 23 23:33:50 WARNING[1074494176]: File chan_iax2.c, Line 5466 (set_config): Ignoring port for now Dec 23 23:33:51 WARNING[1142106560]: File chan_oss.c, Line 238 (sound_thread): Read error on sound device: Resource temporarily unavailable Dec 23 23:33:51 WARNING[1074494176]: File chan_zap.c, Line 7341 (setup_zap): Ignoring rxwink Dec 23 23:33:52 WARNING[1074494176]: File loader.c, Line 239 (ast_load_resource): libpt_linux_x86_r.so.1.5.2: cannot open shared object file: No such file or directory Dec 23 23:33:52 WARNING[1074494176]: File loader.c, Line 407 (load_modules): Loading module chan_h323.so failed! Any help greatly appreciated !!! SW
Jeremy McNamara
2003-Dec-24 08:15 UTC
[Asterisk-Users] when * start at bootup chan_h323 fails to load
SW wrote:>(ast_load_resource): libpt_linux_x86_r.so.1.5.2: cannot open shared object >file: No such file or directory >Dec 23 23:33:52 WARNING[1074494176]: File loader.c, Line 407 (load_modules): >Loading module chan_h323.so failed! > > >RTFM cat /path/to/asterisk/channels/h323/README Jeremy McNamara
Jeremy, Ok, that worked. Thanks for your help, really appreciate it. Let me copy this to the list, someone will find it useful. So, If you want to run * at bootup, and you have chan_h323, (a) then you should modyfy init.asterisk script with the path variables (shown below) and copy it to /etc/init.d, rename to asterisk (or anything) (b) Then do chkconfig --add asterisk and (c) chkconfig asterisk on (d) Now reboot and asterisk will start as a service Merry Christmas. Cheers SW> -----Original Message----- > From: Jeremy McNamara [mailto:jj@nufone.net] > Sent: Wednesday, December 24, 2003 2:25 PM > To: SW > Subject: Re: [Asterisk-Users] when * start at bootup chan_h323 fails to > load > > > You answered your own question here. Your startup environment does not > use /etc/profile, so you have to copy those same directives into the > asterisk startup script, so its environment is properly setup. > > Jeremy > > > SW wrote: > > >Hi Jeremy, > > > >I did read the README. Infact I knew you would love to RTFM :). > > > >Actually, I created the environment for BASH, exactly the way > you asked to > >do. > > > >The question here is; > > > >chan_h323 get started, when I login as root and when I run the > same script > >that I have in /etc/init.d. > > > >But it complaints when it is run at the boot time(so the path is good for > >user root, but not good when it is started at boot time). > > > >So, I must be doing something wrong in setting the environment, > which seems > >only effective when logged in as root. > > > >I am running rh 9, and I put those path variables in /etc/profile. > > > > > >Here is my /etc/profile > > > >HOSTNAME=`/bin/hostname` > >HISTSIZE=1000 > > > >if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then > > INPUTRC=/etc/inputrc > >fi > > > >export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC > > > >for i in /etc/profile.d/*.sh ; do > > if [ -r "$i" ]; then > > . $i > > fi > >done > > > >unset i > > > >PWLIBDIR=/root/pwlib > >export PWLIBDIR > >OPENH323DIR=/root/openh323 > >export OPENH323DIR > >LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib > >export LD_LIBRARY_PATH > > > >also, echo $LD_LIBRARY_PATH gives me what it is. > > > >[sath@localhost sath]$ echo $LD_LIBRARY_PATH > >/root/pwlib/lib:/root/openh323/lib > > > >Is there any other log where we can take a closer look ? Would a complete > >clean and make of pwlib and openh323 would help? > >Things work fine, as far as call processing is concern, so I am > reluctant to > >mess the installation again. > > > >Cheers > > > >SW > > > > > > > >Date: Wed, 24 Dec 2003 10:15:04 -0500 > >From: Jeremy McNamara <jj@nufone.net> > >To: asterisk-users@lists.digium.com > >Subject: Re: [Asterisk-Users] when * start at bootup chan_h323 > fails to load > >Reply-To: asterisk-users@lists.digium.com > > > >SW wrote: > > > > > > > >>(ast_load_resource): libpt_linux_x86_r.so.1.5.2: cannot open > shared object > >>file: No such file or directory > >>Dec 23 23:33:52 WARNING[1074494176]: File loader.c, Line 407 > >> > >> > >(load_modules): > > > > > >>Loading module chan_h323.so failed! > >> > >> > >> > >> > >> > > > >RTFM > > > >cat /path/to/asterisk/channels/h323/README > > > >Jeremy McNamara > > > > > > > >libpt_linux_x86_r.so.1: cannot open shared object file: No such > >file or directory > > > >You have not set the LD_LIBRARY_PATH environment variable. > > > >Example environment for sh/bash: > > > >PWLIBDIR=$HOME/pwlib > >export PWLIBDIR > >OPENH323DIR=$HOME/openh323 > >export OPENH323DIR > >LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib > >export LD_LIBRARY_PATH > > > >We recomend puting the above directives into your /etc/profile so > >you do not have to remember to export those values every time you > >want to recompile. > > > > > > > > > >