I have a following service template:
"resize-xvm@" = {
description = "Resize the VM volume";
before = [ "xvm@%i.service" ];
partOf = [ "xvm@%i.service" ];
serviceConfig.Type = "oneshot";
scriptArgs = "%i";
script = ''
VMNAME="$1"
exec ${zfs} set "volsize=$ROOTVOLSIZE" "${cfg.zfsPath}/$VMNAME"
'';
restartIfChanged = true;
stopIfChanged = true;
serviceConfig.RemainAfterExit = true;
};
and an override for it:
"resize-xvm@${name}" = {
overrideStrategy = "asDropin";
environment = {
ROOTVOLSIZE = toString vm.rootVolSize;
};
restartTriggers = [ vm.rootVolSize ];
restartIfChanged = true;
stopIfChanged = true;
};
What I want to achieve is to get the resize-xvm@${name}
to restart if the vm.rootVolSize
changes. Insofar no combination of xxxIfChanged/xxxTriggers seemed to work. I even tried to remove the template altogether and still don’t get it to restart.
I have a xvms.target
that is wanted by multi-user.target
and wants all the xvm@${name}
and the latter require resize-xvm@%i.service
.
Any idea how to debug this dependency graph?