Re: openrc standardised checkconfig
Jaco Kroon <[email protected]> Tue, 23 Jun 2026 09:37:56 +0200
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
On 2026/06/23 04:18, Michael Orlitzky wrote:
> On 2026-06-22 20:55:39, Jaco Kroon wrote:
>> Hi All,
>>
>> Just naming but a few:
>>
>> apache2, php-fpm uses configtest
>> haproxy, sshd, syslog-ng, dovecot uses checkconfig
>>
>> I'd like to suggest that we at least encourage use of the latter, if not
>> make it a standard function (which just outputs "not supported" if the
>> function isn't found).
> If it's possible to check the config for errors, doing so should be
> baked in to (re)start/reload:
>
> https://github.com/OpenRC/openrc/blob/master/service-script-guide.md#dont-restartreload-with-a-broken-config
>
> Then we don't have to worry about remembering a nonstandard name, or
> at least it becomes a lot less important.
Fully agree with that, and reload/restart *should* peform those checks
as per the link.
In many cases my workflow given a list of changes that needs to be made
is something like:
foreach (changelist as change) {
make_change($change);
while (!validate_config()) /* aka /etc/init.d/$service checkconfig */
fix_config();
}
reload/restart();
Thus exposing this checkconfig as a mechanism would help simplify that
process overall, and I'm sure others do similar. Also, having this as a
standard function means that the boilerplate to invoke that during
{start,stop}_pre also goes away and can become part of the standard
openrc process.
Other scenarios include preparing a configuration for scheduled
reload/restart, where the change is configured during office hours, but
a reload/restart may only occur outside of office hours (often at hours
when people should be sleeping, and fixing things take longer than it
should).
Kind regards,
Jaco