mirror of https://github.com/schoebel/mars
marsadm: skip unnecessary template checks
This commit is contained in:
parent
dcdf848933
commit
bd5b2ef885
|
@ -1519,6 +1519,8 @@ sub __systemd_fingerprint {
|
||||||
|
|
||||||
sub is_systemd_generate_necessary {
|
sub is_systemd_generate_necessary {
|
||||||
my $cmd = shift;
|
my $cmd = shift;
|
||||||
|
# do not generate after forking
|
||||||
|
return 0 if $child_prefix;
|
||||||
my $text = __systemd_fingerprint();
|
my $text = __systemd_fingerprint();
|
||||||
system("mkdir -p $marsadm_var_dir");
|
system("mkdir -p $marsadm_var_dir");
|
||||||
my $varfile = "$marsadm_var_dir/systemd.status";
|
my $varfile = "$marsadm_var_dir/systemd.status";
|
||||||
|
@ -1532,7 +1534,7 @@ sub is_systemd_generate_necessary {
|
||||||
}
|
}
|
||||||
if ($text eq $old_text) {
|
if ($text eq $old_text) {
|
||||||
lprint "systemd template generation not necessary.\n" if $verbose;
|
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";
|
lprint "Forcing template generation...\n";
|
||||||
}
|
}
|
||||||
if (!open(OUT, "> $varfile.tmp")) {
|
if (!open(OUT, "> $varfile.tmp")) {
|
||||||
|
|
Loading…
Reference in New Issue