Catalli's threaded switch
[sliver-openvswitch.git] / debian / corekeeper.init
1 #!/bin/sh 
2 #
3 # Example init.d script with LSB support.
4 #
5 # Please read this init.d carefully and modify the sections to
6 # adjust it to the program you want to run.
7 #
8 # Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
9 # Copyright (c) 2009 Nicira Networks, Inc.
10 #
11 # This is free software; you may redistribute it and/or modify
12 # it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation; either version 2,
14 # or (at your option) any later version.
15 #
16 # This is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License with
22 # the Debian operating system, in /usr/share/common-licenses/GPL;  if
23 # not, write to the Free Software Foundation, Inc., 59 Temple Place,
24 # Suite 330, Boston, MA 02111-1307 USA
25 #
26 ### BEGIN INIT INFO
27 # Provides:          corekeeper
28 # Required-Start:    $remote_fs
29 # Required-Stop:     $remote_fs
30 # Should-Start:      $syslog
31 # Should-Stop:       
32 # Default-Start:     2 3 4 5
33 # Default-Stop:      0 1 6
34 # Short-Description: Configure core file dump location
35 ### END INIT INFO
36
37 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
38
39 . /lib/lsb/init-functions
40
41 set -e
42
43 case "$1" in
44   start)
45         log_daemon_msg "Initializing core dump location..."
46         if echo "/var/log/core/core.%e.%t.%p" > /proc/sys/kernel/core_pattern
47         then
48             log_progress_msg "success"
49             log_end_msg 0
50             exit 0
51         else 
52             log_end_msg 1
53             exit 1
54         fi
55         ;;
56   stop|restart|force-reload|status|reload)
57         exit 0
58         ;;
59   *)
60         N=/etc/init.d/corekeeper
61         echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
62         exit 1
63         ;;
64 esac