Error stop service on linux

Posted by rafmas on 13-Jun-2014 09:18

Hi!

I'm trying to create a service script to start/stop database in CentOs 5.6 with OE10.2b.

When the server start, the service start ok , but on server shutdown the script don't run.

If I execute the command  line "service progress stop", work.

I added the script on service list with this commands:

chkconfig --add progress
chkconfig --level 2345 progress on

chkconfig --list progress
progress 0:off 1:off 2:on 3:on 4:on 5:on 6:off

 the script code /etc/init.d/progress :

#! /bin/sh

# init file for Progress OpenEdge 10.2B #

# chkconfig: 2345 99 01
# description: Progress OpenEdge 10.2B

DLC=/usr/dlc
PROSRV=$DLC/bin/proserve

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

# [ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools

RETVAL=0
prog=OpenEdge_Banco
pidfile=/var/lock/subsys/banco

start()
{
echo -n $"Starting $prog: "
/banco/script/start.sh
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $pidfile
return $RETVAL
}

stop()
{
echo -n $"Shutting down $prog: "
/banco/script/stop.sh
RETVAL=$?
echo
rm -f $pidfile
return $RETVAL
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
echo $"Usage: $0 {start|stop|restart}"
RETVAL=3
esac

The pid file was created.

All Replies

Posted by Nigel Allen on 16-Jun-2014 17:57

I think we would need to see the contents of the script in question.

Can you post start.sh and stop.sh?

Is it chmod +x?

N/

This thread is closed