diff mbox series

[v3,3/8] package/petitboot: use default logfile dir

Message ID 20231009151729.2223963-4-arbab@linux.ibm.com
State Accepted
Headers show
Series package/petitboot: misc fixes/enhancement | expand

Commit Message

Reza Arbab Oct. 9, 2023, 3:17 p.m. UTC
All the petitboot components assume /var/log/petitboot by default;
pb-console can also put multiple logs there and pb-sos collects that
directory when creating a diagnostic tarball.

Defer to this default when launching pb-discover. If someone wants to
override, let's call the file /etc/default/petitboot which makes more
sense to be shared by all the components.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
---
 package/petitboot/S15pb-discover | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Peter Korsgaard Nov. 9, 2023, 4:59 p.m. UTC | #1
>>>>> "Reza" == Reza Arbab <arbab@linux.ibm.com> writes:

 > All the petitboot components assume /var/log/petitboot by default;
 > pb-console can also put multiple logs there and pb-sos collects that
 > directory when creating a diagnostic tarball.

 > Defer to this default when launching pb-discover. If someone wants to
 > override, let's call the file /etc/default/petitboot which makes more
 > sense to be shared by all the components.

 > Signed-off-by: Reza Arbab <arbab@linux.ibm.com>

Committed to 2023.08.x, thanks.
diff mbox series

Patch

diff --git a/package/petitboot/S15pb-discover b/package/petitboot/S15pb-discover
index 9b641298cafa..71ab62d99859 100644
--- a/package/petitboot/S15pb-discover
+++ b/package/petitboot/S15pb-discover
@@ -2,12 +2,9 @@ 
 
 DAEMON="pb-discover"
 PIDFILE="/var/run/$DAEMON.pid"
-LOGFILE="/var/log/$DAEMON.log"
-
-PB_DISCOVER_ARGS="-l $LOGFILE"
 
 # shellcheck source=/dev/null
-[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
+[ -r "/etc/default/petitboot" ] && . "/etc/default/petitboot"
 
 if [ "$(pb-config debug)" = "enabled" ] ; then
 	PB_DISCOVER_ARGS="$PB_DISCOVER_ARGS --verbose"
@@ -15,6 +12,8 @@  fi
 
 start() {
 	printf 'Starting %s: ' "$DAEMON"
+	mkdir -p /var/log/petitboot
+
 	# shellcheck disable=SC2086 # we need the word splitting
 	start-stop-daemon -S -q -b -m -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
 		-- $PB_DISCOVER_ARGS