Bug 248992 - www/radicale add ability to use custom options
Summary: www/radicale add ability to use custom options
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Bernhard Froehlich
Depends on:
Reported: 2020-08-29 18:30 UTC by Daniel Tihanyi
Modified: 2020-12-20 13:36 UTC (History)
2 users (show)

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

Adding radicale_flags to rc file (629 bytes, patch)
2020-08-29 18:30 UTC, Daniel Tihanyi
no flags Details | Diff
Adding radicale_flags to rc file (1.03 KB, patch)
2020-08-30 13:42 UTC, Daniel Tihanyi
daniel.tihanyi: maintainer-approval? (decke)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.
Comment 5 Daniel Tihanyi 2020-12-20 13:36:15 UTC
I'm not using Radicale anymore so this change is not needed.