Subversion Repositories eFlore/Applications.cel

Rev

Rev 2417 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/sh

### BEGIN INIT INFO
# Provides:          tb_cel
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $all
# Should-Stop:       $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop scripts maintenance CEL
# Description:       Start/stop les scripts de maintenance de CEL.
### END INIT INFO

#/etc/rc.d/init.d/
# 
# Aurélien PERONNET [17 avril 2013]
# Service de lancement des scripts de maintenance du CEL
#
case "$1" in

start)

echo "Demarrage de codeinseecommune :"
nohup /usr/local/sbin/codeinseecommune.sh 1>/dev/null 2>/dev/null &

;;

stop)

echo "Arret de codeinseecommune"
PID=`ps -eaf | grep codeinseecommune | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
kill -9 ${PID}

;;

status)

echo -n "Voici les PID du processus codeinseecommune :"
PID=`ps -eaf | grep codeinseecommune | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
echo ${PID}

;;


*)

echo "Usage:  {start|stop|status}"

exit 1

;;

esac