1832580 Members
3151 Online
110043 Solutions
New Discussion

Init Script Problem

 

Init Script Problem

Hi together,
i have a little problem with one of my init scripts and can´t figure out what the problem should be (or im just standing on the line :)
Would be nie if someone could have look on that script.
When i try to start the script with
/sbin/init.d/phoenix-server start
nothing happens no error, it writes no Log File in the /tmp.
When i try to stop the script
/sbin/init.d/phoenix-server stop
it works pretty fine.

Would be pleased about some help
greetings & thanks
Pet
Wer meint gut zu sein hat es verpasst besser zu werden!
5 REPLIES 5
Michael_356
Frequent Advisor

Re: Init Script Problem

Hi there,

at first a question:
Do you have any entry in /etc/rc.log?

Try a set -x as the first line in the script.
This will print all commands and the execution to stdout.

Regards

Michael
Victor BERRIDGE
Honored Contributor

Re: Init Script Problem

Hi,

Having a look...

It seem to exit with 0 if you have nothing...

I would suggest to add some more test to see if it continues after:
'start')
if [ -f /etc/rc.config.d/phoenix-server ] ; then
echo OK!!!
sleep 3
. /etc/rc.config.d/phoenix-server
else
echo "ERROR: /etc/rc.config.d/phoenix-server defaults file MISSING"
sleep 3
exit 1
fi
if [ "$RUN_PHX_SERVER" -ne 1 ]; then
echo "Phoenix Server deactivated!!"
echo RUN_PHX_SERVER = " "$RUN_PHX_SERVER"!"
sleep 5
exit 0
etc...


Good luck
Victor
Victor BERRIDGE
Honored Contributor

Re: Init Script Problem

I ment nothing = no output...
Oh and I forgot..
You should initialize RUN_PHX_SERVER in order to understand whats going on

Let us know how you are getting on

All the best
Victor
Muthukumar_5
Honored Contributor

Re: Init Script Problem

Try to run on command shell first with debug mode as,

set -x in the init script file.

is there any message's on /etc/rc.log file.?

Easy to suggest when don't know about the problem!
John Palmer
Honored Contributor

Re: Init Script Problem

Your script seems to be confusing 14259 and 14240, which is correct?

All su commands should be of the form:
su phoenix -c

If as I suspect that 14240 is the correct value, your code should read something like...
cd $PHOENIX_SERVER_PATH
if [ -x PurchaseServer14240 ] ;
then /usr/bin/su phoenix -c ./PurchaseServer14240 > /tmp/Phoenix_PU.log 2>&1 &
echo "Phoenix Server Started"
else echo "Phoenix Servet NOT FOUND"
exit 1
fi
cd $PHOENIX_SERVER_PATH/../../spool/server
if [ -x SpoolServer14240 ] ;
then /usr/bin/su phoenix -c ./spool/server/SpoolServer14240 > /tmp/Phoenix_SP_S.log 2>&1 &
echo "SpoolServer started"
else echo "Spoolserver NOT FOUND"
exit 1
fi
if [ -x SpoolWorker14240 ] ;
then /usr/bin/su phoenix -c ./SpoolWorker14240 > /tmp/Phoenix_SP_W.log 2>&1 &
echo "SpoolWorker started"
else echo "SpoolWorker NOT FOUND"
exit 1
fi