From bd5b2ef8851879b6ef04b7f378f44fd443a23cda Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Fri, 14 Feb 2020 07:26:11 +0100 Subject: [PATCH] marsadm: skip unnecessary template checks --- userspace/marsadm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/userspace/marsadm b/userspace/marsadm index 07fe9a86..0a0ac0dc 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -1519,6 +1519,8 @@ sub __systemd_fingerprint { sub is_systemd_generate_necessary { my $cmd = shift; + # do not generate after forking + return 0 if $child_prefix; my $text = __systemd_fingerprint(); system("mkdir -p $marsadm_var_dir"); my $varfile = "$marsadm_var_dir/systemd.status"; @@ -1532,7 +1534,7 @@ sub is_systemd_generate_necessary { } if ($text eq $old_text) { lprint "systemd template generation not necessary.\n" if $verbose; - return 0 unless $force; + return 0 unless ($force && $cmd ne "primary"); lprint "Forcing template generation...\n"; } if (!open(OUT, "> $varfile.tmp")) {