From f07f65901b46ccff3bc730b8a4d984e3fc5ba7a2 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 4 Feb 2019 09:52:53 +0100 Subject: [PATCH] marsadm: add systemd presence check --- userspace/marsadm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userspace/marsadm b/userspace/marsadm index 3a61f4f9..55ddcabf 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -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)) {