source: LATMOS-Accounts-Web/etc/init.d/latmos-accounts-web @ 666

Last change on this file since 666 was 666, checked in by nanardon, 14 years ago
  • redirect error output to /dev/null otherwise site don't work with some UTF8
  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/sh
2#
3# Latmos-Account web application
4#
5# chkconfig: 345 97 3
6# description: Latmos-Account web application
7
8. /etc/rc.d/init.d/functions
9[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
10export LC_ALL
11export LANG
12
13USER=nobody
14PORT=4000
15[ -f /etc/sysconfig/latmos-accounts ] && \
16    . /etc/sysconfig/latmos-accounts
17
18RETVAL=0
19prog=latmos_accounts_web
20
21function start () {
22    gprintf "Starting %s: " "$prog"
23    daemon --user $USER /usr/bin/latmos_accounts_web_server.pl --daemon --fork --port $PORT --host localhost --forcehttps 2>/dev/null
24    [ $? -eq 0 ] && success || failure
25    touch /var/lock/subsys/$prog
26    echo
27}
28
29function stop () {
30    gprintf "Stopping %s: " "$prog"
31    killproc latmos_accounts_web_server.pl
32    rm -f /var/lock/subsys/$prog
33    echo
34}
35
36case "$1" in
37    start)
38        start
39        ;;
40    stop)
41        stop
42        ;;
43    status)
44        status latmos_accounts_web_server.pl
45        ;;
46    restart)
47        stop
48        start
49        ;;
50    reload)
51        stop
52        start
53        ;;
54    *)
55        gprintf "Usage: $0 {start|stop|status|restart|reload}\n"
56        exit 1
57esac
58
59exit $RETVAL
Note: See TracBrowser for help on using the repository browser.