From 70ebde01d71223bba45d4b4a6896ffe29930e027 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Thu, 6 May 2021 20:57:29 +0200 Subject: [PATCH] hostconfig: Use make_path to create possible non-existing directory `/node` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # systemctl status startup-tags.service ● startup-tags.service Loaded: loaded (/etc/systemd/system/startup-tags.service; static) Active: failed (Result: exit-code) since Thu 2021-05-06 20:46:29 CEST; 4min 11s ago Process: 1297907 ExecStart=/usr/sbin/hostconfig --populate-node (code=exited, status=2) Main PID: 1297907 (code=exited, status=2) May 06 20:46:29 flughafenberlinbrandenburgwillybrandt systemd[1]: Starting startup-tags.service... May 06 20:46:29 flughafenberlinbrandenburgwillybrandt hostconfig[1297907]: /node/tags: No such file or directory May 06 20:46:29 flughafenberlinbrandenburgwillybrandt systemd[1]: startup-tags.service: Main process exited, code=exited, status=2/INVALIDARGUMENT May 06 20:46:29 flughafenberlinbrandenburgwillybrandt systemd[1]: startup-tags.service: Failed with result 'exit-code'. May 06 20:46:29 flughafenberlinbrandenburgwillybrandt systemd[1]: Failed to start startup-tags.service. --- hostconfig/hostconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostconfig/hostconfig b/hostconfig/hostconfig index 6283c05..f4a5df3 100755 --- a/hostconfig/hostconfig +++ b/hostconfig/hostconfig @@ -57,7 +57,7 @@ sub populate_node { my ($hostname)=@_; my $DIR='/node/tags'; -d $DIR and system "rm -rf $DIR" and exit 1; - mkdir $DIR or die "$DIR: $!\n"; + make_path $DIR or die "$DIR: $!\n"; my $tags=$TAGS{$hostname}; for (keys %$tags) { open my $touch,'>',"$DIR/$_";