I have a templated service for which each instance needs to receive
arguments of the form "foo/bar".  This works fine when starting the
service:

  # systemctl start myservice@foo/bar.service

But trying to *enable* this service results in an error:

  # systemctl enable myservice@foo/bar
  Failed to issue method call: Invalid argument

I'm assuming this happens because systemd is trying to create a symlink
with a "/" in the name and is falling over.  I can think of a number of
ways of dealing with this:

A. I just write a wrapper script that accepts multiple arguments,
   builds a command line, and runs the service.  I don't like this
   solution because I was trying to avoid wrapping everything in shells
   cripts.

B. Use some form of quoting for filenames to avoid this
   problem.  E.g., in this case, create a link on disk named
   'myservice@foo%2Fbar' (assuming URL-style  quoting).

C. Reject instance names that contain "/" characters.

Thoughts? I'm going with A as an immediate solution, but I'd prefer
something like B in the long run.

-- 
Lars Kellogg-Stedman <l...@oddbit.com>


_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to