[Bug 279578] security/vaultwarden - newsyslog support

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 07 Jun 2024 20:20:59 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279578

            Bug ID: 279578
           Summary: security/vaultwarden - newsyslog support
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: mr@FreeBSD.org
          Reporter: ohaucke@gadean.de
          Assignee: mr@FreeBSD.org
             Flags: maintainer-feedback?(mr@FreeBSD.org)

Hey there,  
with the current rc.d script, vaultwarden doesn't write to the log file, if it
gets rotated by
[newsyslog.conf(5)](https://man.freebsd.org/cgi/man.cgi?query=newsyslog.conf).

Example configuration:
```
# logfilename               [owner:group]   mode    count   size    when   
flags   [/pid_file]                             [sig_num]
/var/log/vaultwarden.log    www:wheel       640     5       10240   *       JC 
    /var/run/vaultwarden/vaultwarden.pid    SIGUSR1
```

After some digging, i've found out that
[daemon(8)](https://man.freebsd.org/cgi/man.cgi?daemon(8)) is being used and it
has one argument (`-r`) which restarts the child process, if it has been
terminated.

I've tested it with `-r` in the `command_args` and ran `newsyslog`:  
The log file got rotated and the vaultwarden process wrote to the new log file
- as expected.

Would it be possible to integrate that argument in the `command_args` of the
rc.d script?

There is one caveat that needs some consideration:  
If the child process fails to start - due to what ever reason - it would
continuously been started again?

Regards,
Oliver

-- 
You are receiving this mail because:
You are the assignee for the bug.