Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hostconfig: Use mkdir -p to create possible non-existing directory …
…`/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 authored and donald committed Dec 7, 2022
1 parent 935c089 commit 73a2922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hostconfig/hostconfig
Expand Up @@ -56,8 +56,8 @@ sub evalue_expression {
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";
-d $DIR and system 'rm', '-rf', $DIR and exit 1;
system 'mkdir', '-p', $DIR and exit 1;
my $tags=$TAGS{$hostname};
for (keys %$tags) {
open my $touch,'>',"$DIR/$_";
Expand Down

0 comments on commit 73a2922

Please sign in to comment.