]> err.no Git - scalable-opengroupware.org/blob - Scripts/sogo-init.d-redhat
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1120 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / Scripts / sogo-init.d-redhat
1 #!/bin/bash
2
3 # SOGo init script for RedHat
4 #
5 # Copyright (C) 2007 Inverse groupe conseil
6 #
7 # Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
8 #
9 # This file is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This file is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; see the file COPYING.  If not, write to
21 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 # Boston, MA 02111-1307, USA.
23
24 # sogod         Scalable OpenGroupware.org (Inverse edition)
25 #
26 # chkconfig:    - 85 15
27 # description:  SOGo is a groupware server
28 # processname:  sogod-0.9
29 # config:       /etc/sysconfig/sogo
30 # config:       /etc/httpd/conf.d/SOGo.conf
31 # pidfile:      /var/run/sogo/sogod.pid
32
33 PATH=/sbin:/bin:/usr/sbin:/usr/bin
34
35 . /etc/rc.d/init.d/functions
36
37 DAEMON=/usr/sbin/sogod
38 NAME=sogo
39 DESC="Scalable OpenGroupware.Org (Inverse edition)"
40
41 PIDFILE=/var/run/sogo/sogod.pid
42
43 SOGO_ARGS=""
44
45 if [ -f /etc/sysconfig/sogo ]; then
46     . /etc/sysconfig/sogo
47 fi
48
49 test -x $DAEMON || exit 0
50
51 #set -e
52
53 case "$1" in
54   start)
55         echo -n $"Starting $DESC: " / 
56         daemon --user sogo --pidfile $PIDFILE $DAEMON
57         echo "$NAME."
58         ;;
59   stop)
60         echo -n $"Stopping $DESC: "
61         killproc --pidfile $PIDFILE $DAEMON
62         rm -f $PIDFILE
63         echo "$NAME."
64         ;;
65   restart|force-reload)
66         echo -n $"Restarting $DESC: "
67         killproc --pidfile $PIDFILE $DAEMON
68         rm -f $PIDFILE
69         sleep 1
70         daemon --user sogo --pidfile $PIDFILE $DAEMON
71         echo "$NAME."
72         ;;
73   status)
74         status $DAEMON
75         ;;
76   *)
77         N=/etc/init.d/$NAME
78         echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
79         exit 1
80         ;;
81 esac
82
83 exit 0
84