2009-07-08 13:19:16 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# Example init.d script with LSB support.
|
|
|
|
|
#
|
|
|
|
|
# Please read this init.d carefully and modify the sections to
|
|
|
|
|
# adjust it to the program you want to run.
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
|
2009-08-28 13:05:48 -07:00
|
|
|
# Copyright (c) 2009 Nicira Networks, Inc.
|
2009-07-08 13:19:16 -07:00
|
|
|
#
|
|
|
|
|
# This is free software; you may redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation; either version 2,
|
|
|
|
|
# or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This is distributed in the hope that it will be useful, but
|
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License with
|
|
|
|
|
# the Debian operating system, in /usr/share/common-licenses/GPL; if
|
|
|
|
|
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
|
|
|
|
# Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
#
|
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
|
# Provides: corekeeper
|
|
|
|
|
# Required-Start:
|
|
|
|
|
# Required-Stop:
|
|
|
|
|
# Should-Start: $syslog
|
|
|
|
|
# Should-Stop:
|
|
|
|
|
# Default-Start: 2 3 4 5
|
|
|
|
|
# Default-Stop: 0 1 6
|
|
|
|
|
# Short-Description: Configure core file dump location
|
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
|
|
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
|
start)
|
|
|
|
|
log_daemon_msg "Initializing core dump location..."
|
2009-08-28 13:05:48 -07:00
|
|
|
if echo "/var/log/core/core.%e.%t.%p" > /proc/sys/kernel/core_pattern
|
2009-07-08 13:19:16 -07:00
|
|
|
then
|
|
|
|
|
log_progress_msg "success"
|
|
|
|
|
log_end_msg 0
|
|
|
|
|
exit 0
|
|
|
|
|
else
|
|
|
|
|
log_end_msg 1
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
stop|restart|force-reload|status|reload)
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
N=/etc/init.d/$NAME
|
|
|
|
|
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|