source coredump.conf and check for $coredump_enabled

pull/291/head
Paul Philippov 2022-07-09 07:38:52 -04:00
parent 0955f92aee
commit ca57f473ea
10 changed files with 20 additions and 31 deletions

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?

View File

@ -12,9 +12,8 @@ load_majestic() {
printf 'Starting %s: ' "$DAEMON" printf 'Starting %s: ' "$DAEMON"
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, " [ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
# shellcheck disable=SC2086 # we need the word splitting # shellcheck disable=SC2086 # we need the word splitting
if [ -f /etc/coredump.conf ] && [ "true" = "$(grep ^savedumps /etc/coredump.conf | cut -d= -f2)" ]; then [ -f /etc/coredump.conf ] && . /etc/coredump.conf
ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern [ "$coredump_enabled" ] && ulimit -c unlimited && echo "| /usr/sbin/sendcoredump.sh" > /proc/sys/kernel/core_pattern
fi
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \ start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS -- $DAEMON_ARGS
status=$? status=$?
@ -76,4 +75,3 @@ case "$1" in
echo "Usage: $0 {start|stop|restart|reload}" echo "Usage: $0 {start|stop|restart|reload}"
exit 1 exit 1
esac esac