Skip to content

Commit

Permalink
varnish: add migration for moving stateDir
Browse files Browse the repository at this point in the history
PL-132901
  • Loading branch information
Philipp Neumann committed Aug 29, 2024
1 parent c447159 commit d1d4861
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nixos/services/varnish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ in {
reloadIfChanged = true;
restartTriggers = [ cfg.extraCommandLine vcfg.package cfg.http_address ];
reload = ''
vadm="${vcfg.package}/bin/varnishadm -n ${vcfg.stateDir}"
if [ -d "${vcfg.stateDir}" ]; then
statedir="${vcfg.stateDir}"
else
statedir="/var/spool/varnish/${config.networking.hostName}" #temporary migration
fi
vadm="${vcfg.package}/bin/varnishadm -n $statedir"
cat ${commandsfile} | $vadm
coldvcls=$($vadm vcl.list | grep " cold " | ${pkgs.gawk}/bin/awk {'print $5'})
Expand Down

0 comments on commit d1d4861

Please sign in to comment.