Skip to content

Commit a987d59

Browse files
SuvarnaMeenakshisanthosh-kt
authored andcommitted
[systemd-generator]: Remove creation of NUM_ASIC environment (sonic-net#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 <sumeenak@microsoft.com>
1 parent 4c1eb4a commit a987d59

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/systemd-sonic-generator/systemd-sonic-generator.c

-10
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ static int get_num_of_asic() {
498498
Determines if the current platform is single or multi-ASIC
499499
***/
500500
FILE *fp;
501-
FILE *env_fp;
502501
char *line = NULL;
503502
char* token;
504503
char* platform;
@@ -546,15 +545,6 @@ static int get_num_of_asic() {
546545
free(line);
547546
}
548547
}
549-
550-
/*set environment variable NUM_ASIC */
551-
env_fp = fopen("/etc/environment", "a");
552-
if (env_fp == NULL) {
553-
fprintf(stderr, "Failed to open environment file\n");
554-
exit(EXIT_FAILURE);
555-
}
556-
fprintf(env_fp, "NUM_ASIC=%d\n", num_asic);
557-
fclose(env_fp);
558548
return num_asic;
559549

560550
}

0 commit comments

Comments
 (0)