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