Mise en place Script Start/Stop Domino sur Fedora/Linux (7/7)
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
avant tout, 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 coller le contenu du script ci-dessous (Mettre à jour les parametres en rouge)
#!/bin/sh
# chkconfig: 2345 99 00
# Startup script for Domino
# description: This script starts the
Domino server in a screen session \
#
And ensures a proper shutdown before the system goes down.
# Author: Oystein Baarnes <dominolinux@baarnes.com>
DESC="Domino"
SrvAcc="notes"
DominoDir="/local/notesdata"
DominoSrv="/opt/ibm/lotus/bin/server"
TimeOutKill=150
TasksToKill="server replica router
update stats logasio adminp sched calconn event pop3 imap maps ldap http
smtp mtc amgr"
tok=0
. /etc/rc.d/init.d/functions
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
success
touch /var/lock/subsys/domino
else
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
success
else
failure
$0 kill
fi
else
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
success
rm -f /var/lock/subsys/domino
else
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
Mise en place d'un reboot periodique :
editer la configuration de Cron en lancant la commande :
- vi /etc/crontab
Ajouter la ligne suivante et enregistrer
00 05 * * * root reboot
Cette commande déclenchera le reboot quotidien à 05H00
00 05 * * 0 root reboot
Cette commande déclenchera le reboot chaque dimanche à 05H00
Software by
-