<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jun 12, 2015 at 11:03 AM Lincoln Peters <<a href="mailto:anfrind@gmail.com" target="_blank">anfrind@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In our case, the parameter is passed through to the start script as a command-line argument, and if, for example, I issue the following commands:<br><br>systemctl start myserver@alethkar<br>systemctl start myserver@frostlands<br>systemctl start myserver@jah-keved<br><br>The first two instances start as expected, but the third fails because systemd escapes the parameter to "jah\-keved"* before passing it to my script, no matter if I use %i (escaped instance name) or %I (unescaped instance name) in my .service file, which would seem to contradict what the documentation says.  As you might expect, when my start script sees the "escaped" parameter, it gets confused and does the wrong thing.  I may need to modify my start script to un-escape the parameter itself in order to make it work.<br></div></blockquote><div><br></div></div></div><p dir="ltr">I figured out what's going on (and, yes, the escaped parameter in my original post was wrong).  It turns out that systemd treats slashes as a special character and "escapes" them into dashes (and escapes dashes into a hex representation), and it expects that any parameter passed as an argument to systemctl has *already* been escaped.  So in the aforementioned case of "myserver@jah-keved", it un-escapes the parameter to "jah/keved", which my service recognizes as invalid.<br></p>
<p dir="ltr">If I want "jah-keved" to be passed to my start script, I need to issue the following command:<br></p>
<p dir="ltr">systemctl start myserver@jah\x2dkeved<br></p>
<p dir="ltr">So...yeah.</p>