Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (87 sloc) 2.868 kb
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh -e
2 #
3 # interchange.init - Interchange start-stop script
4 #
9650b1b Jon Jensen Update copyright dates.
jonjensen authored
5 # Copyright (C) 2000-2003 Stefan Hornburg (Racke) <racke@linuxia.de>
ab9523d Stefan Hornburg (Racke) copyright added
racke authored
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public
18 # License along with this program; if not, write to the Free
19 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 # MA 02111-1307 USA.
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
21
22 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
23 DAEMON=/usr/sbin/interchange
24 NAME=interchange
25 DESC="Interchange Server"
26
27 test -f $DAEMON || exit 0
28
29 # modes that Interchange uses
30 # possible values are
31 # --unix Unix mode only (default)
32 # --inetmode Internet mode only
33 # --unix --inetmode Unix and Internet mode
34 MODE="--unix"
35 USER=interchange
36 . /etc/interchange/init.cfg
37
38 case "$1" in
39 start)
3485ca0 Stefan Hornburg (Racke) work in progress
racke authored
40 # skip start during unfinished installation
41 if [ -f /var/run/interchange-install ]; then
42 exit 0
43 fi
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
44 echo -n "Starting $DESC: "
45 start-stop-daemon --start --quiet --pidfile /var/run/interchange/$NAME.pid \
46 --chuid $USER --exec $DAEMON -- --serve $MODE \
47 -f /etc/interchange/interchange.cfg
48 ;;
49 stop)
d27c6e3 Stefan Hornburg (Racke) small change in the restart logic
racke authored
50 # skip stop during unfinished installation
51 if [ -f /var/run/interchange-install ]; then
52 exit 0
53 fi
54
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
55 echo -n "Stopping $DESC: "
56
57 start-stop-daemon --stop --oknodo --pidfile /var/run/interchange/$NAME.pid
58 echo "$NAME."
59 ;;
60 #reload)
61 #
62 # If the daemon can reload its config files on the fly
63 # for example by sending it SIGHUP, do it here.
64 #
65 # If the daemon responds to changes in its config file
66 # directly anyway, make this a do-nothing entry.
67 #
68 # echo "Reloading $DESC configuration files."
69 # start-stop-daemon --stop --signal 1 --quiet --pidfile \
70 # /var/run/$NAME.pid --exec $DAEMON
71 #;;
72 restart|force-reload)
73 #
74 # If the "reload" option is implemented, move the "force-reload"
75 # option to the "reload" entry above. If not, "force-reload" is
76 # just the same as "restart".
77 #
78
79 echo -n "Restarting $DESC: "
80 start-stop-daemon --stop --pidfile /var/run/interchange/$NAME.pid
81 echo "$NAME."
82 sleep 1
83
84 start-stop-daemon --start --quiet --pidfile /var/run/interchange/$NAME.pid \
85 --chuid $USER --exec $DAEMON -- --serve $MODE \
86 -f /etc/interchange/interchange.cfg
87 ;;
88 *)
89 N=/etc/init.d/$NAME
90 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
91 echo "Usage: $N {start|stop|restart|force-reload}" >&2
92 exit 1
93 ;;
94 esac
95
96 exit 0
Something went wrong with that request. Please try again.