On Tue, 9 Dec 2025, Ian Jackson wrote:
Ben Harris writes ("Bug#1039361: SAUCE/systemd status"):
[stuff]
Thanks very much for the help.
Your overall apporach seems reasoable.
sauce-run expects SAUCE_USER to specify what user to run SAUCE as, and I
think will default to root if it's not set. But the "stop" action of
sauce.init assumes when invoking start-stop-daemon that SAUCE is running
as "mail", which suggests that maybe any setting other than "mail" doesn't
work properly.
This seems a likely bug. I may fix it.
systemd doesn't make it easy to extract the user to run
the service as from /etc/sauce/sys-config, so for now I've cheated and
hard-coded "mail" into systemd.service. The admin can override it using a
drop-in, but this would make upgrades a bit messy for people who set
SAUCE_USER to something other than "mail".
Fair enough.
It occurs to me that it might be practical to have a post-install script
that extracts SAUCE_USER from /etc/sauce/sys-config and generates a
corresponding /etc/systemd/system/sauce.service.d/user.conf. Doing that
would be simple, but I worry about whether it's appropriate in a
maintainer script and about all the edge cases.
In any case, this may justify a note in NEWS.Debian.
I've copied the code for waiting for SAUCE to start up from sauce.init
into sauce.service. This has not made it any less shonky.
I think we should factor this out somewhere. We could make a separate
small shell script?
That sounds like a good plan. Something like sauce-await-startup that
returns success if SAUCE has started properly and failure if it hasn't
(though systemd will detect that itself anyway).
Next I want to sort out some kind of tests for this, which will probably
be a bit harder.
There is already an autopkgtest. It currently passes, under systemd,
under autopkgtest-virt-qemu, using systemd's init script emulation.
My branch contained an attempt to adjust the test so that it doesn't
start sauce for the first time with the init script.
Oh, I think Lintian suggested something that would help with that:
https://lintian.debian.org/tags/init.d-script-does-not-source-init-functions.html
--
Ben Harris