File: corekeeper.init.kfreebsd

package info (click to toggle)
corekeeper 1.7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 84 kB
  • sloc: sh: 137; makefile: 9
file content (45 lines) | stat: -rw-r--r-- 1,214 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh
### BEGIN INIT INFO
# Provides:          corekeeper
# Required-Start:    $local_fs
# Required-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: enable core files and report crashes to the sysadmin
# Description:       This script simply enables sysctl values for corekeeper on kFreeBSD
#                    because procps and freebsd-utils do not do this.
### END INIT INFO

# Author: Paul Wise <pabs@debian.org>

PATH=/sbin:/bin

[ -x /lib/freebsd/sysctl ] || exit 0
[ -s /etc/sysctl.d/corekeeper.conf ] || exit 0

. /lib/init/vars.sh
. /lib/lsb/init-functions

if [ "$VERBOSE" != no ] ; then
	QUIET=-q
fi

case "$1" in
	start|restart|force-reload|reload)
		[ "$VERBOSE" != no ] && log_action_begin_msg "Applying corekeeper sysctl settings"
		STATUS=0
		sed /etc/sysctl.d/corekeeper.conf -e "s/\( \|\t\)*//g" -e "/^#/d" -e "/^$/d" \
		| (while read i ; do /lib/freebsd/sysctl $QUIET ${i} >/dev/null || STATUS=$? ; done)
		[ "$VERBOSE" != no ] && log_action_end_msg $STATUS
	;;
	stop)
		/lib/freebsd/sysctl kern.sugid_coredump=0
		/lib/freebsd/sysctl kern.corefile=%N.core
	;;
	status)
	;;
  	*)
		echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
		exit 3
	;;
esac