mirror of
https://github.com/schoebel/mars
synced 2024-12-28 18:03:12 +00:00
marsadm: add systemd presence check
This commit is contained in:
parent
a211bdce33
commit
f07f65901b
@ -392,6 +392,15 @@ sub instantiate_systemd_unit {
|
||||
return (1, $outfile);
|
||||
}
|
||||
|
||||
sub systemd_present {
|
||||
my ($cmd, $res) = @_;
|
||||
my $unit_glob = "$mars/resource-$res/systemd-*-unit";
|
||||
return 0 unless glob($unit_glob);
|
||||
my $want_path = "$mars/resource-$res/systemd-want";
|
||||
my $want = get_link($want_path, 2);
|
||||
return $want;
|
||||
}
|
||||
|
||||
sub systemd_exists {
|
||||
my ($unit_list) = @_;
|
||||
foreach my $unit (split(/ +/, $unit_list)) {
|
||||
|
Loading…
Reference in New Issue
Block a user