Projet esup-ecm

Recherche

Sommaire

Pages enfant
  • Installation de ESUP-ECM (Obsolète)

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Bloc de code
 
         #!/bin/sh
         #
         # openoffice This         # chkconfig: 345 97 1
         # description: this shell script takes care of starting and stopping
         #         # openoffice server.
         #

          case "$1" in

            start)
              echo "Starting openoffice: "
              Xvfb :8100 2>/dev/null &
             sleep 5
             /opt/openoffice.org2.4/program/soffice.bin -headless "-accept=socket,host=localhost,port=8100;urp;StarOffice.Service" 2>/dev/null &
             echo
           ;;

          stop)
             ps -aef|grep "program/soffice.bin" | grep -v grep|cut -c10-15 >/var/run/ooo.pid
            val=`head /var/run/ooo.pid`
             if [ -n $val ]
              then
                 kill $val 2>/dev/null && echo "Shutting down openoffice: " $val
              fi
             ps -aef|grep "Xvfb" | grep -v grep|cut -c10-15 >/var/run/xvfb.pid
             val=`head /var/run/xvfb.pid`
            if [ -n $val ]
               then
                kill $val 2>/dev/null && echo "Shutting down virtual xterm: " $val
           fi   
           echo
          ;;

          restart)
             $0 stop
             $0 start
          ;;

          status)
            echo "Servers listening on port 8100 :"
            netstat -na | grep :8100 | wc -l
            netstat -na | grep :8100
            echo "openoffice processes :"
            ps -aef | grep -i program/soffice | grep -v grep
            echo "X processes :"
            ps -ef | grep -i xvfb | grep -v grep
        ;;

      *)
          echo "Usage: nxopenoffice [start|stop|restart|status]\n"
          exit 1

      esac

     exit 0

...