source: trunk/LATMOS-Accounts/etc/init.d/la-sync-manager @ 2318

Last change on this file since 2318 was 861, checked in by nanardon, 13 years ago
  • reimport missing files from previous svn
  • Property svn:executable set to *
File size: 939 bytes
Line 
1#!/bin/sh
2#
3# la-sync-manager startup script
4#
5# chkconfig: 345 97 3
6# description: Manage synchronisation between latmos-account bases
7
8. /etc/rc.d/init.d/functions
9[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
10export LC_ALL
11export LANG
12
13USER=nobody
14[ -f /etc/sysconfig/latmos-accounts ] && \
15    . /etc/sysconfig/latmos-accounts
16
17RETVAL=0
18prog=la-sync-manager
19
20function start () {
21    gprintf "Starting %s: " "$prog"
22    daemon --user $USER /usr/bin/la-sync-manager
23    [ $? -eq 0 ] && success || failure
24    touch /var/lock/subsys/$prog
25    echo
26}
27
28function stop () {
29    gprintf "Stopping %s: " "$prog"
30    killproc la-sync-manager
31    rm -f /var/lock/subsys/$prog
32    echo
33}
34
35case "$1" in
36    start)
37        start
38        ;;
39    stop)
40        stop
41        ;;
42    status)
43        status la-sync-manager
44        ;;
45    restart)
46        stop
47        start
48        ;;
49    reload)
50        la-sync -b
51        ;;
52    *)
53        gprintf "Usage: $0 {start|stop|status|restart|reload}\n"
54        exit 1
55esac
56
57exit $RETVAL
Note: See TracBrowser for help on using the repository browser.