[systemd-devel] soft-reboot and service templates
Luca Boccassi
luca.boccassi at gmail.com
Thu Jun 6 20:52:49 UTC 2024
On Thu, 6 Jun 2024 at 09:15, Thorsten Kukuk <kukuk at suse.com> wrote:
>
> On Wed, Jun 5, 2024 at 3:58 PM Luca Boccassi <luca.boccassi at gmail.com> wrote:
> >
> > On Wed, 5 Jun 2024 at 14:45, Thorsten Kukuk <kukuk at suse.com> wrote:
> > >
> > > Hi,
> > >
> > > while playing with soft-reboot and services surviving this:
> > > A standard service file works, but if I use a service template (e.g.
> > > test at .service), the service get's stopped during soft-reboot.
> > > Reasons is:
> > > -Slice=system.slice
> > > +Slice=system-test.slice
> > did you try adding a
> > drop-in for system-test.slice.d that sets the parameters to avoid
> > having it stopped on softreboot?
>
> I tried that, but no idea what I'm doing wrong, the values there seem
> to get ignored. systemctl show only displays the old values.
It works for me in latest main:
# systemctl cat test at .service
# /etc/systemd/system/test at .service
[Service]
RootImage=/usr/share/minimal_0.raw
ExecStart=sleep infinity
[Unit]
SurviveFinalKillSignal=yes
IgnoreOnIsolate=yes
DefaultDependencies=no
# systemctl cat system-test.slice
# /etc/systemd/system/system-test.slice.d/foo.conf
[Unit]
SurviveFinalKillSignal=yes
IgnoreOnIsolate=yes
DefaultDependencies=no
With these, test at foo survives a soft-reboot. I guess this should be
documented in the manpage, I'll take care of it.
More information about the systemd-devel
mailing list