Hi Lorenzo,
On Wed, Dec 03, 2025 at 12:33:55PM +0100, Lorenzo wrote:
> On Sat, 29 Nov 2025 13:51:33 +0000 Andrew Bower <[email protected]> wrote:
> > The default-syslog virtual service does not know about the
> > forthcoming metalog package[1].
>
> default-syslog is scheduled for removal, although not in the next Debian
> version of runit.
>
> > I suggest a patch along the lines of
> > the attached to prepare for this implementation of syslog joining
> > debian.
>
> I can add 'metalog-log' [*] for now; if I add 'metalog' it won't work
> when this is removed.
> I intend to remove default-syslog in this cycle, just after renaming
> other syslogs services; given that renaming a service in runit is non
> trivial extra work I think is better to get the name right from the
> start.
>
> Best,
> Lorenzo
>
> [*]or metalog.log if that's looks less ugly, the format of the 'log'
> suffix is open for changes until other services are renamed.
> Constrains are that it has to work with
> 'sv start|check /etc/service/*.log'
> and it has to be unique enough that there are no false matches
Naming the runit service is one thing but in the first instance there is
no runit service so while default-syslog prevails it would need to
invoke a command that will launch the initscript, which is going to be
called 'metalog', regardless of what a future runit service directory
will do. 'service metalog X' will therefore do the right thing while
default-syslog still exists.
But I would like to suggest considering an alternative approach to
launching facilities that doesn't involve impinging on the services
namespace - it is generally helpful, in my view, that service names and
application/package names tend to match and that their naming is
consistent across service integrations for the different init systems.
The approach I prototyped, building on an earlier suggestion, but using
a process as the integration point (as you prefer!) rather than a shell
function, enables the existence of a facility to be flagged simply by a
marker file. I prototyped it in Perl but it could be reworked as a shell
script:
===> /usr/sbin/facility <===
#!/usr/bin/perl -w
use strict;
use File::Basename;
use File::Glob qw(bsd_glob);
my $svdir = $ENV{SVDIR} // "/etc/service";
my $command = shift or die "usage: $0 command facility...";
my %providers = map {
map {
basename(dirname($_)) => 1
} bsd_glob("$svdir/*/provides-$_")
} @ARGV;
exec ("sv", $command, keys %providers) if %providers;
===> Some typical facility provides <===
sv/connman/provides-network
sv/dhclient/provides-network
sv/network-manager/provides-network
sv/rsyslog/provides-syslog
sv/unbound/provides-named
sv/wicd/provides-network
===> /etc/sv/acme/run <===
#! /lib/runit/invoke-run
facility start network syslog || exit 1
exec chpst -u _acmed:_acmed -012 /usr/sbin/acmed -D