I have script that runs OpenERP server, but I seems to be not working on new server for some reason (I use same script on another server and it works fine).
when I enter command such as:
openerp-server-7.0 start
I get:
Starting openerp-server-7.0:
But actually nothing starts. No openerp runs and no log file is created. When I enter:
openerp-server-7.0 stop
I get this:
Stopping openerp-server-7.0: start-stop-daemon: warning: failed to kill 30449: No such process
If I check pid files directory. There is pid file with pid number that error says there is no such process. It seems postgress can't find that location where new pid process is being created.
My script:
#! /bin/sh
### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Resource Management software
# Description: Tiny ERP is a complete ERP and CRM software.
### END INIT INFO
DAEMON=/home/user/openerp/7.0/server/openerp-server
VERSION=7.0
USER=user
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=openerp-server-$VERSION
DESC=$NAME
GROUP=$USER
DAEMON_DIR="/home/$USER/openerp/$VERSION/server"
CONFIG="/home/$USER/etc/openerp-server-$VERSION.conf"
DAEMON_OPTS="$DAEMON_DIR/openerp-server --config=$CONFIG"
DATA_BASE_DIR="/home/$USER/var/run"
test -x $DAEMON || exit 0
set -e
make_dir()
{
DIR=$1
if [ -d "$DIR" ]; then
return 0;
fi
mkdir -p -m 0755 "$DIR"
chown "$USER:$GROUP" "$DIR"
}
make_dir $DATA_BASE_DIR
case "$1" in
start)
echo -n "Starting $DESC: "
cd $DAEMON_DIR
start-stop-daemon --start --quiet --pidfile $DATA_BASE_DIR/$NAME.pid \
--chuid $USER --background --make-pidfile \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $DATA_BASE_DIR/$NAME.pid \
--oknodo
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $DATA_BASE_DIR/$NAME.pid \
--oknodo
sleep 1
cd $DAEMON_DIR
start-stop-daemon --start --quiet --pidfile $DATA_BASE_DIR/$NAME.pid \
--chuid $USER --background --make-pidfile \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0