Re: soft-reboot and service templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Jun 2024 at 09:15, Thorsten Kukuk <kukuk@xxxxxxxx> wrote:
>
> On Wed, Jun 5, 2024 at 3:58 PM Luca Boccassi <luca.boccassi@xxxxxxxxx> wrote:
> >
> > On Wed, 5 Jun 2024 at 14:45, Thorsten Kukuk <kukuk@xxxxxxxx> 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@.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@.service
# /etc/systemd/system/test@.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@foo survives a soft-reboot. I guess this should be
documented in the manpage, I'll take care of it.




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux