[systemd-devel] Pairing udev's SYSTEMD_WANTS and systemd's templated units

Ivan Shapovalov intelfx100 at gmail.com
Fri Aug 15 03:01:24 PDT 2014


On Friday 15 August 2014 at 11:34:28, Lennart Poettering wrote:	
> On Fri, 15.08.14 09:58, Harald Hoyer (harald.hoyer at gmail.com) wrote:
> 
> > 
> > On 14.08.2014 17:27, Lennart Poettering wrote:
> > > On Thu, 14.08.14 17:10, Harald Hoyer (harald.hoyer at gmail.com) wrote:
> > > 
> > >>
> > >> On 14.08.2014 13:00, Lennart Poettering wrote:
> > >>> On Thu, 14.08.14 10:02, Ivan Shapovalov (intelfx100 at gmail.com) wrote:
> > >>>
> > >>>> The only thing: PROGRAM="...", ENV{SYSTEMD_WANTS}+="...%c..." idiom seems a
> > >>>> pretty ugly way to invoke systemd-escape. This looks like a pretty common
> > >>>> thing to do; shouldn't there be a shorthand or something? (just a suggestion)
> > >>>
> > >>> Yeah, I agree, but I not entirely sure how this could look like in a
> > >>> nice way?
> > >>>
> > >>> Maybe add:
> > >>>
> > >>> ENV{SYSTEMD_WANTS_INSTANCE}="bar"
> > >>> ENV{SYSTEMD_WANTS_TEMPLATE}="foo at .service"
> > >>>
> > >>> or so, would escape "bar" and add it into foo at .service... But that's not
> > >>> particularly generic but focusses only on the instance/template case...
> > >>>
> > >>> Ideas?
> > >>>
> > >>> Lennart
> > >>>
> > >>
> > >> Why not extend udev with new % specifiers for the systemd escaped name?
> > > 
> > > What syntax would you propose? Note that there are probably a couple of
> > > different strings people might want to have escaped?
> > > 
> > > Lennart
> > > 
> > 
> > We could probably make it $[<path>], which would result in $[$devpath] $[%p]
> 
> Well, there are at least two modes how to escape strings for unit names
> (one for general string, one for paths). This would become awfully
> complex...
> 
> Lennart
> 
> 

$[...] and ${...} maybe.

-- 
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140815/c72dfde1/attachment.sig>


More information about the systemd-devel mailing list