[PATCH]: redhat startup scripts should no longer use -u user

Ingvar Hagelund ingvar at redpill-linpro.com
Fri Sep 4 16:29:44 CEST 2015

Den 04. sep. 2015 01:31, skrev Federico Schwindt:
> Hi,
> Why not reusing VARNISH_USER and introduce VARNISH_CCGROUP instead of
> adding VARNISH_JAIL?

Because it doesn't work with systemd*. The systemd EnvironmentFile file
parser does not recognice a variable unless it starts with
whitespace-dollar. And you can't stack the parameters with variables in
variables, as the params file is just read line-for-line, and not
executed as a shell script.

so this works

ExecStart=/usr/sbin/varnishd \

while this does not, as there are no spaces before the dollar signs

ExecStart=/usr/sbin/varnishd \
 -j unix,user=$VARNISH_USER,ccgroup=$VARNISH_CCGROUP \

# systemctl start varnish
sep. 04 15:55:22 netcat.linpro.no varnishd[9681]: Error: Unix jail:
$VARNISH_USER user not found.


*) The "pure" systemd way is to stop using external shell-like
configuration files that expands into command line options, that is, not
the EnvironmentFile hack.

When I asked about this some months ago on the systemd irc channel, I
was asked in the not too humble systemd way, to tell upstream to do the
"right thing", that is, stop using command line options. In short of a
suitable reply, I disconnected, ate some chocolate, and read a good book.

More information about the varnish-dev mailing list