tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: www/tinyproxy issues under netbsd/amd64 (11.0_STABLE)
Chuck Cranor <chuck%ece.cmu.edu@localhost> writes:
> I think the solution to this is to copy what is done in
> /etc/rc.d/mdnsd with the start_precmd:
>
> --- /tmp/tinyproxy_ORIG 2026-09-25 11:56:39.334016066 -0400
> +++ /etc/rc.d/tinyproxy 2026-09-25 11:57:34.470342487 -0400
> @@ -13,6 +13,16 @@
> command="/usr/pkg/bin/${name}"
> pidfile="/var/run/tinyproxy/${name}.pid"
> required_files="/usr/pkg/etc/${name}.conf"
> +start_precmd="tinyproxy_precmd"
> +
> +tinyproxy_precmd()
> +{
> + if [ ! -d /var/run/tinyproxy ]; then
> + mkdir -p -m 755 /var/run/tinyproxy
> + fi
> + chown tinyproxy:tinyproxy /var/run/tinyproxy
> +}
> +
>
> load_rc_config $name
> run_rc_command "$1"
>
> unless there is a better way?
That looks like the right approach. I would say feel free to commit it
if works for you. Don't conclude that what's there must be ok for
others, because there may well be zero others trying, noticing and reporting.
> [2] the package PLIST creates /var/log/tinyproxy using an @exec.
> but the example tinyproxy.conf has both the LogFile and Syslog
> commented out:
>
> # egrep '^#LogFile|^#Syslog' /usr/pkg/share/examples/tinyproxy/tinyproxy.conf.default
> #LogFile "/var/log/tinyproxy/tinyproxy.log"
> #Syslog On
>
> this causes tinyproxy to disable logging at startup with the warning:
>
> # /etc/rc.d/tinyproxy start
> Starting tinyproxy.
> WARNING: logging deactivated (can't log to stdout when daemonized)
>
> looking at the code, it prints that WARNING if both the LogFile and
> the Syslog are disabled (which makes sense). the source code says
> it can only log to one or the other (not both).
>
> so if pkgsrc wants tinyproxy to use the /var/log/tinyproxy directory
> it created, it should uncomment the LogFile directive in the conf file?
> I think that could be done with an updated patch-etc_tinyproxy.conf.in
> file?
>
> though it might be nice if there were some sort of pkgsrc option
> that let the user choose to direct logs to either the file or
> syslog, but i'm not sure how you'd do that.
My take is that syslog is the standard approach for logging, that the
default config should specify it, and the code to create specific log
dirs removed. I realize that webservers have a culture of their own
logdirs, but they often don't rotate leading to out of space problems.
It's the sysadmin's job to deal with syslog.conf and newsyslog.conf for
this, and if people don't like that, then we should set up /etc/syslog.d
and /etc/newsyslog.d so we can install single-line fragments for them
for specific programs. That may or may not be a good idea, but IMHO we
should not try to sort of do that piecemeal.
Home |
Main Index |
Thread Index |
Old Index