added my Recipes
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
From e415152b51eacab8705b6b3274cc0d1a274772e0 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 30 Aug 2022 19:54:35 -0700
|
||||
Subject: [PATCH] libtrace: Use XSI version of strerror_r on non glibc systems
|
||||
|
||||
The version used is glibc specific therefore make it so
|
||||
and provide a fallback for non-glibc systems
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/mchehab/rasdaemon/pull/70]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
libtrace/event-parse.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/libtrace/event-parse.c b/libtrace/event-parse.c
|
||||
index 6c705c3..6b651d5 100644
|
||||
--- a/libtrace/event-parse.c
|
||||
+++ b/libtrace/event-parse.c
|
||||
@@ -5071,7 +5071,13 @@ int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
|
||||
const char *msg;
|
||||
|
||||
if (errnum >= 0) {
|
||||
+#if defined(__GLIBC__)
|
||||
msg = strerror_r(errnum, buf, buflen);
|
||||
+#else
|
||||
+ if (strerror_r(errnum, buf, buflen) != 0)
|
||||
+ snprintf(buf, buflen, "unknown error %i", errnum);
|
||||
+ msg = buf;
|
||||
+#endif
|
||||
if (msg != buf) {
|
||||
size_t len = strlen(msg);
|
||||
memcpy(buf, msg, min(buflen - 1, len));
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#! /bin/sh
|
||||
# /etc/init.d/rasdaemon: start rasdaemon service
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Defaults
|
||||
PIDFILE=/var/run/rasdaemon.pid
|
||||
BINFILE=/usr/sbin/rasdaemon
|
||||
SCRIPTNAME=/etc/init.d/rasdaemon
|
||||
|
||||
[ -x $BINFILE ] || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting RASdaemon services: "
|
||||
if [ ! -f "$PIDFILE" ]; then
|
||||
start-stop-daemon --start --quiet --exec $BINFILE -- --enable &> /dev/null
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $BINFILE -- --record
|
||||
pidof $BINFILE > $PIDFILE
|
||||
fi
|
||||
[ -f $PIDFILE ] && echo "done." || echo "fail."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping RASdaemon services: "
|
||||
if [ -f "$PIDFILE" ] ; then
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $BINFILE -- --disable &> /dev/null
|
||||
killproc $BINFILE
|
||||
rm $PIDFILE
|
||||
fi
|
||||
[ ! -f $PIDFILE ] && echo "done." || echo "fail."
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
status $BINFILE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|status}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=RAS daemon to log the RAS events
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/rasdaemon -f -r
|
||||
ExecStartPost=/usr/sbin/rasdaemon --enable
|
||||
ExecStop=/usr/sbin/rasdaemon --disable
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user