Skip to content

Commit

Permalink
[systemd-generator]: Remove creation of NUM_ASIC environment (sonic-n…
Browse files Browse the repository at this point in the history
…et#5122)

NUM_ASIC environment variable was added so that it could be used by other utilities.
This is not being used by any other utility or docker, hence removing the addition of NUM_ASIC environment variable.
Also, the environment variable was added by adding the variable value to /etc/environ file.
Upon each reboot, this file gets updated with the NUM_ASIC value but the existing value was not removed.
This causes multiple lines getting appended in /etc/environ file upon each reboot.

Signed-off-by: SuvarnaMeenakshi <[email protected]>
  • Loading branch information
SuvarnaMeenakshi authored and santhosh-kt committed Feb 25, 2021
1 parent 4c1eb4a commit a987d59
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/systemd-sonic-generator/systemd-sonic-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ static int get_num_of_asic() {
Determines if the current platform is single or multi-ASIC
***/
FILE *fp;
FILE *env_fp;
char *line = NULL;
char* token;
char* platform;
Expand Down Expand Up @@ -546,15 +545,6 @@ static int get_num_of_asic() {
free(line);
}
}

/*set environment variable NUM_ASIC */
env_fp = fopen("/etc/environment", "a");
if (env_fp == NULL) {
fprintf(stderr, "Failed to open environment file\n");
exit(EXIT_FAILURE);
}
fprintf(env_fp, "NUM_ASIC=%d\n", num_asic);
fclose(env_fp);
return num_asic;

}
Expand Down

0 comments on commit a987d59

Please sign in to comment.