Bug 288957 - devel/forgejo-runner: add supervisor mode for daemon(8)
Summary: devel/forgejo-runner: add supervisor mode for daemon(8)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-19 13:18 UTC by Vyacheslav
Modified: 2025-11-16 19:13 UTC (History)
2 users (show)

See Also:
daniel: maintainer-feedback+


Attachments
patch for act_runner.in (1.43 KB, patch)
2025-08-19 13:18 UTC, Vyacheslav
no flags Details | Diff
Fix precmd (342 bytes, patch)
2025-11-16 13:14 UTC, Vyacheslav
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vyacheslav 2025-08-19 13:18:36 UTC
Created attachment 263075 [details]
patch for act_runner.in

Same bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287384

If the server is not available when act_runner starts, act_runner terminates.
In my case, I have a jail with www/forgejo and act_runner. When jail starts, forgejo takes about 5 seconds to initialize a web server that act_runner could connect to, and during that time, act_runner terminates.

I used the patch in the attachment to put daemon(8) in supervisor mode, and that fixed my problem.

Notes:
1. This is a breaking change - previously set act_runner_flags specified in rc.conf are applied to daemon(8), not act_runner. To pass parameters to act_runner, act_runner_args is used.
2. The system must be updated due to FreeBSD-EN-25:06.daemon

P.S. In theory, we can remove the '-r' flag from command_args. This will preserve compatibility with unpatched systems and allow us to add it manually via act_runner_flags where needed. However, I'm not sure if we should use the '-P' flag without the '-r' flag.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2025-08-20 01:08:43 UTC
^Triage: now that Attachments have the 'patch' flag, the "[patch]" convention
is obsolete.
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-14 13:58:23 UTC
Correct port name and add maintainer to CC.
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-14 14:03:49 UTC
Version in port is outdated.
Current version is 11.3.1: https://code.forgejo.org/forgejo/runner/src/tag/v11.3.1.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-15 23:49:10 UTC
While here fix build with non-default user/group (make ACT_RUNNER_USER=_test_user_):
@@ -28,11 +28,14 @@ DATADIR=    /var/db/${PORTNAME}

 DATADIR=       /var/db/${PORTNAME}

-USERS= ${ACT_RUNNER_USER}
-GROUPS=        ${ACT_RUNNER_GROUP}
-
 ACT_RUNNER_USER?=      ${PORTNAME}
 ACT_RUNNER_GROUP?=     ${PORTNAME}
+.if ${ACT_RUNNER_USER} == ${PORTNAME}
+USERS= ${ACT_RUNNER_USER}
+.endif
+.if ${ACT_RUNNER_GROUP} == ${PORTNAME}
+GROUPS=        ${ACT_RUNNER_GROUP}
+.endif

 post-install:
        ${MKDIR} ${STAGEDIR}${DATADIR} ${STAGEDIR}${ETCDIR}
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-11-15 23:58:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ddd9e80ebb9f5f16bcd3de0d2e43fcf3e1b3f837

commit ddd9e80ebb9f5f16bcd3de0d2e43fcf3e1b3f837
Author:     Vyacheslav <terehovv@mail.ru>
AuthorDate: 2025-11-15 23:54:56 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-11-15 23:54:56 +0000

    devel/forgejo-runner: Add supervisor mode for daemon(8)

    If the server is not available when act_runner starts, act_runner
    terminates.

    Notes:
    1. This is a breaking change - previously set act_runner_flags specified
       in rc.conf are applied to daemon(8), not act_runner. To pass
       parameters to act_runner, act_runner_args is used.
    2. The system must be updated due to FreeBSD-EN-25:06.daemon.

    While here fix build with non-default user/group and split long line.

    PR:     288957

 devel/forgejo-runner/Makefile            | 14 +++++++++-----
 devel/forgejo-runner/files/act_runner.in | 25 ++++++++++++++-----------
 2 files changed, 23 insertions(+), 16 deletions(-)
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-16 00:04:56 UTC
Thanks.

Daniel, do you plan to update the version?
Comment 7 Vyacheslav 2025-11-16 13:14:08 UTC
Created attachment 265450 [details]
Fix precmd

Thanks.

Unfortunately, I made a mistake while creating the original patch. The new patch fixes it.
Or should I open a new bug?
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-16 19:13:32 UTC
Daniel?