Bug 275300

Summary: [PATCH] www/angie: Create/delete logs directory using hooks
Product: Ports & Packages Reporter: oleg
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: New ---    
Severity: Affects Some People CC: fuz
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Create/delete logs directory using hooks
none
[PATCH] Create/delete directories using hooks
none
[PATCH] Create/delete directories using hooks none

Description oleg 2023-11-24 10:02:11 UTC
This allows end-user to change permissions on log directory based on their
preferences or security concerns and they won't be reset on upgrade.
Comment 1 oleg 2023-11-24 10:02:36 UTC
Created attachment 246535 [details]
Create/delete logs directory using hooks
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2024-02-20 13:35:10 UTC
This is probably better solved by creating the directory in the rc.d script and leaving it out of the package entirely.

That said, instead of adding installation and deinstallation scripts, you should at least do something like adding

    @preexec mkdir -p %%LOGDIR%%
    @postunexec rmdir %%LOGDIR%% 2>/dev/null || true

to pkg-plist.

I have asked on the ports IRC channel for the proper way to do this and will report back if there is a better solution.
Comment 3 oleg 2024-03-05 21:08:36 UTC
Created attachment 248955 [details]
[PATCH] Create/delete directories using hooks

Updated with given recommendations, thanks
Comment 4 oleg 2024-03-05 21:37:15 UTC
Created attachment 248956 [details]
[PATCH] Create/delete directories using hooks

Fixed wrong lines folding