added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
#!/bin/sh
#
# minicoredumper This shell script takes care of starting and stopping minicoredumper.
#
# chkconfig: 2345 24 89
# description: minicoredumper.
#
# processname:
# config: /etc/minicoredumper/
### BEGIN INIT INFO
# Provides: minicoredumper
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: $syslog $network
# Should-Stop: $syslog $network
# Short-Description:
# Description:
### END INIT INFO
. /etc/init.d/functions
case "$1" in
start)
echo "|/usr/sbin/minicoredumper %p %u %g %s %t %h %e" > /proc/sys/kernel/core_pattern
;;
stop)
echo "core" > /proc/sys/kernel/core_pattern
;;
status)
if grep -q minicoredumper /proc/sys/kernel/core_pattern ; then
echo "minicoredumper is running"
else
echo "minicoredumper is stopped"
fi
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 2
esac

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Enable minicoredumper.
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c '/bin/echo "|/usr/sbin/minicoredumper %%p %%u %%g %%s %%t %%h %%e" > /proc/sys/kernel/core_pattern'
ExecStop=/bin/sh -c '/bin/echo "core" > /proc/sys/kernel/core_pattern'
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo minicoredumper_demo
echo expecting Segmentation fault with core dump ...
minicoredumper_demo 6 & sleep 3 && minicoredumper_demo
if ls /var/crash/ | grep minicoredumper; then
echo SUCCESS
else
echo FAIL
fi