Bug 248992

Summary: www/radicale add ability to use custom options
Product: Ports & Packages Reporter: Daniel Tihanyi <daniel.tihanyi>
Component: Individual Port(s)Assignee: Bernhard Froehlich <decke>
Status: New ---    
Severity: Affects Some People CC: daniel.tihanyi, decke
Priority: --- Flags: bugzilla: maintainer-feedback? (decke)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Adding radicale_flags to rc file
none
Adding radicale_flags to rc file daniel.tihanyi: maintainer-approval? (decke)

Description Daniel Tihanyi 2020-08-29 18:30:33 UTC
Created attachment 217621 [details]
Adding radicale_flags to rc file

This patch will add the possibility to add custom flags using rc.conf. This is useful for example for logging redirection as radicale cannot log to and logs will be printed on the console, but also in other situations where flags are needed.
Comment 1 Daniel Tihanyi 2020-08-30 13:42:38 UTC
Created attachment 217652 [details]
Adding radicale_flags to rc file

Now with version bump.
Comment 2 Bernhard Froehlich freebsd_committer 2020-08-31 18:52:42 UTC
Sorry but this patch won't work. ${name}_flags is an well known variable used by rc.subr 

#       rc_flags        Flags to start the default command with.
#                       Defaults to ${name}_flags, unless overridden
#                       by $flags from the environment.
#                       This variable may be changed by the precmd method.

See:  https://svnweb.freebsd.org/base/head/libexec/rc/rc.subr?revision=354129&view=markup#l885

and it is used to build the command that is run at line 1123:

$command $rc_flags $command_args

so we will end up with:

/usr/sbin/daemon ${radicale_flags} -P ${pidfile} /usr/local/bin/radicale -C ${radicale_config} ${radicale_flags}

which is nonsense.

A simple test to verify with radicale_flags="--debug" set:

root@radicale:~ # /usr/local/etc/rc.d/radicale restart
radicale not running? (check /var/run/radicale/radicale.pid).
Starting radicale.
daemon: illegal option -- -
usage: daemon [-cfrS] [-p child_pidfile] [-P supervisor_pidfile]
              [-u user] [-o output_file] [-t title]
              [-l syslog_facility] [-s syslog_priority]
              [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]
command arguments ...
/usr/local/etc/rc.d/radicale: WARNING: failed to start radicale
Comment 3 Daniel Tihanyi 2020-09-04 12:27:29 UTC
(In reply to Bernhard Froehlich from comment #2)
Hello Bernhard,
thank you for the feedback. Would it work if we were using "radicale_extra_flags" or "radicale_extra_options" as a variable name?
Thank you!
Comment 4 Bernhard Froehlich freebsd_committer 2020-10-12 19:34:41 UTC
As I already described the patch does not work the way you expected it. Renaming the variable to something else will do.