If you want to run Rendezvous with daemon init.d function, it should look like:
start_rvrd() {
P=rvrd
PORT=2777
echo -n $"Starting RV service [$P]: "
cd $RVRD_DATADIR
# create data files first (if not exists)
touch "$P.store" && chmod 666 "$P.store"
daemon --check $P --user USER $P -store \
$RVRD_DATADIR/$P.store -listen $PORT \
-logfile $RVRD_DATADIR/$P.log \
-log-max-size $LOG_MAX_SIZE \
-log-max-rotations $LOG_MAX_ROTATIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$P
}
For EMS it is not similar since EMS cannot daemonize itself. We usually use
daemonize utility to run it properly:
start_emsd() {
P=emsd
echo -n $"Starting EMS service [$P]: "
cd $EMS_DATADIR
daemon --check $P --user USER \
/usr/local/sbin/daemonize \
/srv/tibco/ems/bin/$P \
-config $EMS_CONFIG
# return value is always zero in this case
pidof $P >/dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo
touch /var/lock/subsys/$P
else
failure
fi
}
This should work.
Žádné komentáře:
Okomentovat