[systemd-devel] [PATCH] install: make "reenable" work with templated units

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Jul 13 18:41:56 PDT 2013


On Sat, Jul 13, 2013 at 10:51:01PM +0200, Ross Lagerwall wrote:
> On Sat, Jul 13, 2013 at 04:12:33PM +0200, Zbigniew Jędrzejewski-Szmek wrote:
> > On Mon, Jun 17, 2013 at 07:11:50PM +0100, Ross Lagerwall wrote:
> > > Before, "systemctl reenable getty at tty1.service" would fail with:
> > > Failed to issue method call: File exists
> > > To fix this, reimplement "reenable" explicitly as a disable followed by
> > > an enable.
> > > This is shorter and is how the man page documents its behavior.
> > > ---
> > >  src/shared/install.c |   38 +++++---------------------------------
> > >  1 file changed, 5 insertions(+), 33 deletions(-)
> > Hm, I don't get this error with "reenable", but your patch indeed 
> > simplifies things, so I don't see a reason not to apply it: applied now.
> 
> 
> As far as I can recall, it would fail if
> /etc/systemd/system/getty.target.wants/getty at tty1.service is set up as a
> symlink to /usr/lib/systemd/system/getty at .service and then "systemctl
> reenable getty at tty1.service" is run. 
That's the scenario I tested, and it worked (and works) fine.
There have been some changes to make unit disabling more robust,
so this might have been fixed as a side effect.

We really should grow some test cases for unit enabling/disabling/starting,
it seems that there are some gray areas.

Zbyszek


More information about the systemd-devel mailing list