Rechercher

Tag Cloud

Publicité


Copyright

Creative Commons License Software by Laurent Bruère is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Based on a work at www.Bruere.com. Permissions beyond the scope of this license may be available at Laurent@Bruere.com.

Me contacter

« Mise en place Script Start/Stop Domino sur Fedora/Linux | Accueil| Lotus Domino freeware : Messages Routing Reporting with Excel Graphs »

Start/Stop Domino Script for Linux/Fedora/OpenSuse


Domino must be started when the server start and stoped when the server shutdown, to do this follow the instruction below.
This script has been tested on Fedora and OpenSuse and may work with all Linux

Creation of the script Start/Stop for Domino :

enter the command «  vi /etc/init.d/domino » then copy paste the script below - Update the parameters in RED if needed

#!/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: "
          ulimit -n 20000
          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

 

Give execute permission with the command :

  • chmod +x /etc/init.d/domino

Enable the deamon Script with the command :

  • chkconfig --add domino

Verify the deamon Script with the command :

 chkconfig -l

Now, You can start domino with /etc/init.d/domino start and stop domino with /etc/init.d/domino stop (the process are killed if no shutdown within 180 seconds)

 

 

You may set a wekly server reboot :

Edit the cron configuration file :

  • vi /etc/crontab

Add this line for a reboot each monday at 8H00

00      08      *       *       1       root    reboot