Bug 285628 - [devel/athens]: Add rc script and sample config
Summary: [devel/athens]: Add rc script and sample config
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-24 14:54 UTC by Einar Bjarni Halldórsson
Modified: 2025-03-28 11:04 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments
Adds an rc script for running athens as a daemon (2.52 KB, patch)
2025-03-24 14:55 UTC, Einar Bjarni Halldórsson
no flags Details | Diff
Fixed rc script to use %%PREFIX%% and %%ETCDIR%% (2.50 KB, patch)
2025-03-25 12:05 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval? (bofh)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Einar Bjarni Halldórsson 2025-03-24 14:54:58 UTC
The devel/athens port only installs the /usr/bin/athens binary, but no rc script to run it as a daemon.
Comment 1 Einar Bjarni Halldórsson 2025-03-24 14:55:56 UTC
Created attachment 258975 [details]
Adds an rc script for running athens as a daemon
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-03-25 10:07:13 UTC
The rc file is not prefix safe. Use a .in file and replace all the presence of /usr/local with %%PREFIX%%.
Comment 3 Einar Bjarni Halldórsson 2025-03-25 12:05:30 UTC
Created attachment 259019 [details]
Fixed rc script to use %%PREFIX%% and %%ETCDIR%%
Comment 4 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-03-25 12:11:25 UTC
Thanks. Not required this time as I will do it but this needs a PORTREVISION bump as the packaging is changing.
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-03-25 12:11:47 UTC
Thanks. Not required this time as I will do it but this needs a PORTREVISION bump as the packaging is changing.
Comment 6 Einar Bjarni Halldórsson 2025-03-25 12:17:34 UTC
I just realised that I added both a `post-stage` and `post-install` target, that both attempt to do the same thing.

You can remove the `post-stage` target before committing
Comment 7 commit-hook freebsd_committer freebsd_triage 2025-03-27 09:19:01 UTC
A commit in branch main references this bug:

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

commit 38c1efb470830e8c41c97360a479094085a02db3
Author:     Einar Bjarni Halldórsson <einar@isnic.is>
AuthorDate: 2025-03-25 12:03:58 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-03-27 09:17:13 +0000

    devel/athens: Refactor

    - Add rc script
    - Add sample config file

    PR:             285628

 devel/athens/Makefile              | 11 +++++++----
 devel/athens/files/athens.in (new) | 33 +++++++++++++++++++++++++++++++++
 devel/athens/pkg-plist (new)       |  2 ++
 3 files changed, 42 insertions(+), 4 deletions(-)
Comment 8 Einar Bjarni Halldórsson 2025-03-27 09:33:04 UTC
Thanks for committing, *but* I just realised I never tacked running the service under a different user than root.

I'm going to create a patch that adds a UID and GID to /usr/ports/UIDs and /usr/ports/GIDs and configures a user and group variable to the rc script.

Should we re-open this PR or should I open another one?
Comment 9 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2025-03-27 09:34:25 UTC
Open a new one. Find a suitable user/group of same IDs please.