Skip to content

Commit

Permalink
hostconfig: Use make_path to create possible non-existing directory `…
Browse files Browse the repository at this point in the history
…/node`

    # 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.
  • Loading branch information
pmenzel committed May 6, 2021
1 parent 935c089 commit 70ebde0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hostconfig/hostconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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/$_";
Expand Down

0 comments on commit 70ebde0

Please sign in to comment.