Re: dovecot, init script - is this expected or PR worthy?
On Tue, Feb 11, 2014 at 11:24 AM, Benjamin Podszun benjamin.pods...@gmail.com wrote: Hey there. Setting up a machine with ansible, stumbling upon a couple of problems. The current issue? Part of my automated setup calls service dovecot start and .. that succeeds always, if dovecot_enable=YES is missing (which totally is an error on my part, obviously). What I expect though is the typical Can't do that, Dave. Try onestart perhaps response - and some exit code that signals failure. Dovecot's init script wraps all the standard rc stuff in this if though: if checkyesno ${name}_enable; then for config in ${dovecot_config}; do required_files=${config} command_args=-c ${config} base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F '= ' '/^base_dir =/ { print $2 }') pidfile=${base_dir}/master.pid run_rc_command $1 done fi = checkyesno returns false, script silently exits and 'service dovecot start' seemingly succeeded, no message given. Looking at other services at least a message appears (but the exit code is still 0): service unbound start Cannot 'start' unbound. Set unbound_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'. Is that a (tiny, minor) bug? Should I submit a PR for that? Or is that totally irrelevant and people out there would never fall for that anyway..? The checkyesno ${name}_enable is not needed, as the run_rc_command will check the value of ${name}_enable and output a warning if it is not set. Not sure why the maintainer added that in there. But one possible reason was so that the script wouldn't output a warning for each ${dovecot_config} (since it can be a list of config's to start). Go ahead and submit a PR for this inconsistent behavior. -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: dovecot, init script - is this expected or PR worthy?
On Wednesday, February 12, 2014 2:56:18 AM CEST, Stephen R Guglielmo wrote: On Tue, Feb 11, 2014 at 12:24 PM, Benjamin Podszun benjamin.pods...@gmail.com wrote: service dovecot start and .. that succeeds always, if dovecot_enable=YES is missing (which totally is an error on my part, obviously). What I expect though is the typical Can't do that, Dave. Try onestart perhaps response - and some exit code that signals failure. Is that a (tiny, minor) bug? Should I submit a PR for that? Or is that totally irrelevant and people out there would never fall for that anyway..? Thanks, Ben Hey, I can't reproduce this on my system. I typically run the rc.d/ scripts myself, but I did try using the `service` command as well. It works as expected: The script returns no output when dovecot_enable is commented out or set equal to NO in my /etc/rc.conf.local file, and it does not start or stop the dovecot processes. I'm using dovecot 1.2.17 on 10.0-RELEASE. Are you using dovecot 2? Hi. I .. think my mail was probably too convoluted and messy. My point? service foo start shouldn't be silent if the service isn't starting. The default rc functions ensure that, give the 'Need foo_enable or onestart instead' message. Dovecot's rc script doesn't, because it doesn't even _invoke_ the rc functions if dovecot_enable != YES. (dovecot2 for me, btw - but you described seeing exactly what I see: Nothing, but the service isn't starting either) The whole point is that this silently fails. Is that okay? Regards, Ben ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
dovecot, init script - is this expected or PR worthy?
Hey there. Setting up a machine with ansible, stumbling upon a couple of problems. The current issue? Part of my automated setup calls service dovecot start and .. that succeeds always, if dovecot_enable=YES is missing (which totally is an error on my part, obviously). What I expect though is the typical Can't do that, Dave. Try onestart perhaps response - and some exit code that signals failure. Dovecot's init script wraps all the standard rc stuff in this if though: if checkyesno ${name}_enable; then for config in ${dovecot_config}; do required_files=${config} command_args=-c ${config} base_dir=$(${command} ${command_args} -a | /usr/bin/awk -F '= ' '/^base_dir =/ { print $2 }') pidfile=${base_dir}/master.pid run_rc_command $1 done fi = checkyesno returns false, script silently exits and 'service dovecot start' seemingly succeeded, no message given. Looking at other services at least a message appears (but the exit code is still 0): service unbound start Cannot 'start' unbound. Set unbound_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'. Is that a (tiny, minor) bug? Should I submit a PR for that? Or is that totally irrelevant and people out there would never fall for that anyway..? Thanks, Ben ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: dovecot, init script - is this expected or PR worthy?
On Tue, Feb 11, 2014 at 12:24 PM, Benjamin Podszun benjamin.pods...@gmail.com wrote: service dovecot start and .. that succeeds always, if dovecot_enable=YES is missing (which totally is an error on my part, obviously). What I expect though is the typical Can't do that, Dave. Try onestart perhaps response - and some exit code that signals failure. Is that a (tiny, minor) bug? Should I submit a PR for that? Or is that totally irrelevant and people out there would never fall for that anyway..? Thanks, Ben Hey, I can't reproduce this on my system. I typically run the rc.d/ scripts myself, but I did try using the `service` command as well. It works as expected: The script returns no output when dovecot_enable is commented out or set equal to NO in my /etc/rc.conf.local file, and it does not start or stop the dovecot processes. I'm using dovecot 1.2.17 on 10.0-RELEASE. Are you using dovecot 2? ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org