Mise en place Script Start/Stop Domino sur Fedora/Linux
Ce document décrit les étapes nécessaires pour demarrer et arreter Domino en meme temps que Linux, et décrit également comment parametrer le systeme pour reboter Linux quotidiennement. Cette procédure est valable pour les autres distributions/versions de linux que Fedora FC7
Si nécéssaire , Mettre à l’heure la machine en lancant la commande :
- ntpdate ntp.univ-lyon1.fr
Installation du Script Start/Stop pour Domino :
Faire « vi /etc/init.d/domino » et copier
coller le contenu du script ci-dessous (Mettre à jour les parametres en
rouge)
#!/bin/sh
# chkconfig: 2345 99 00
# description: This script starts and
stop the Domino server \
#
and ensures a proper shutdown before the system goes down.
# Author: Oystein Baarnes <dominolinux@baarnes.com>
Modified by Laurent@Bruere.com
# processname: domino
### BEGIN INIT INFO
# Provides:
domino
# Default-Start: 2 3
4 5
# Default-Stop: 0
1 6
# Short-Description: Startup script
for Domino
# description: This script starts and
stop the Domino server
### END INIT INFO
DESC="Domino"
SrvAcc="notes"
DominoDir="/local/notesdata"
DominoSrv="/opt/ibm/lotus/bin/server"
TimeOutKill=180
TasksToKill="server replica router
update stats logasio adminp sched calconn event pop3 imap maps ldap http
smtp mtc amgr"
tok=0
if [ -f /lib/lsb/init-functions ];
then
. /lib/lsb/init-functions
alias START_DAEMON=start_daemon
alias STATUS=MyStatus
alias LOG_SUCCESS=log_success_msg
alias LOG_FAILURE=log_failure_msg
alias LOG_WARNING=log_warning_msg
elif [ -f /etc/init.d/functions ];
then
. /etc/init.d/functions
alias START_DAEMON=daemon
alias STATUS=status
alias LOG_SUCCESS=success
alias LOG_FAILURE=failure
alias LOG_WARNING=passed
else
echo "Error: your platform
is not supported by $0" > /dev/stderr
exit 1
fi
getpid() {
pid=`/sbin/pidof
-s server`
}
getpid
case "$1" in
start)
if
[ "$pid" = "" ]; then
echo -n "Starting $DESC: "
su - $SrvAcc -c "cd $DominoDir && $DominoSrv " > /dev/null
2>&1 &
sleep 3
getpid
if [ "$pid" != "" ]; then
LOG_SUCCESS
touch /var/lock/subsys/domino
else
LOG_FAILURE
fi
echo
fi
;;
stop)
TimeOutKill=$[TimeOutKill/2]
echo
-n "Shutting down $DESC: "
if
[ "$pid" != "" ]; then
su - $SrvAcc -c "cd $DominoDir && $DominoSrv -quit "
> /dev/null &
# Let's wait for the Domino to terminate
while [ "$pid" != "" ] && [ "$tok"
!= "$TimeOutKill" ] ; do
tok=$[tok+1]
sleep 2
getpid
done
if [ "$tok" != "$TimeOutKill" ] ; then
LOG_SUCCESS
else
LOG_FAILURE
$0 kill
fi
else
LOG_FAILURE
fi
echo
;;
kill)
echo
-n "Killing $DESC: "
kill
-9 `/sbin/pidof -s $TasksToKill` > /dev/null
sleep
1
kill
-9 `/sbin/pidof -s $TasksToKill` > /dev/null
sleep
1
tmp=`/sbin/pidof
-s $TasksToKill`
if
[ "$tmp" = "" ]; then
LOG_SUCCESS
rm -f /var/lock/subsys/domino
else
LOG_FAILURE
fi
echo
;;
status)
STATUS server
;;
restart)
if [ "$pid"
!= "" ]; then
$0
stop
fi
$0
start
;;
*)
echo
echo "Usage:
domino {start|stop|kill|restart|status}"
echo
exit 1
;;
esac
Mettre en place le script en lançant les commandes
- chmod +x /etc/init.d/domino
- chkconfig --add domino
- chkconfig -l (pour vérification)
Mise en place d'un reboot hebdomadaire :
editer la configuration de Cron en lancant la commande :
- vi /etc/crontab
00 08 * * 1 root reboot
Cette commande déclenchera un reboot chaque lundi à 08H00
Software by
-