pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

forgejo-runner: implement a log file



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Tue Sep 1 21:12:29 2026 +0200
Changeset:	d85161a9b9f21a137775d14ec6361fcb7122d8b5

Modified Files:
	forgejo-runner/files/forgejo-runner.sh

Log Message:
forgejo-runner: implement a log file

Tested on NetBSD/amd64, macOS/amd64.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d85161a9b9f21a137775d14ec6361fcb7122d8b5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 forgejo-runner/files/forgejo-runner.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diffs:
diff --git a/forgejo-runner/files/forgejo-runner.sh b/forgejo-runner/files/forgejo-runner.sh
index 822f9d7922..e8b6dd62dc 100644
--- a/forgejo-runner/files/forgejo-runner.sh
+++ b/forgejo-runner/files/forgejo-runner.sh
@@ -15,7 +15,8 @@ name="forgejo_runner"
 rcvar=${name}
 required_files="@PKG_SYSCONFDIR@/config.yaml"
 command="@PREFIX@/bin/forgejo-runner"
-command_args="--config @PKG_SYSCONFDIR@/config.yaml daemon > /dev/null &"
+command_args="--config @PKG_SYSCONFDIR@/config.yaml daemon >> @VARBASE@/log/forgejo-runner.log 2>&1 &"
+start_precmd="forgejo_runner_start_precmd"
 
 forgejo_runner_env="HOME=@FORGEJO_RUNNER_USER_HOME@"
 forgejo_runner_env="${forgejo_runner_env} PATH=@PREFIX@/bin:$PATH"
@@ -23,6 +24,16 @@ forgejo_runner_env="${forgejo_runner_env} PATH=@PREFIX@/bin:$PATH"
 forgejo_runner_user="@FORGEJO_RUNNER_USER@"
 forgejo_runner_group="@FORGEJO_RUNNER_GROUP@"
 
+forgejo_runner_start_precmd()
+{
+	logfile="@VARBASE@/log/forgejo-runner.log"
+
+	if [ ! -f "$logfile" ]; then
+		touch "$logfile"
+		chown "$forgejo_runner_user:$forgejo_runner_group" "$logfile" || true
+	fi
+}
+
 cd /
 
 load_rc_config $name


Home | Main Index | Thread Index | Old Index