Skip to content

Commit 3b4323a

Browse files
authored
Merge pull request #182 from polycube-network/frisso-fix-run-as-root-bug
Fixing misleading message when polycubed is not executed as root
2 parents 1bb4fd9 + 5270372 commit 3b4323a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/polycubed/src/polycubed.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ int main(int argc, char *argv[]) {
173173
exit(EXIT_SUCCESS);
174174
}
175175
} catch (const std::exception &e) {
176+
177+
// The problem of the error in loading the config file may be due to
178+
// polycubed executed as normal user
179+
if (getuid())
180+
logger->critical("polycubed should be executed with root privileges");
181+
176182
logger->critical("Error loading config: {}", e.what());
177183
exit(EXIT_FAILURE);
178184
}
@@ -182,7 +188,7 @@ int main(int argc, char *argv[]) {
182188
logger->set_level(config.getLogLevel());
183189

184190
if (getuid()) {
185-
logger->critical("please run polycubed as root");
191+
logger->critical("polycubed should be executed with root privileges");
186192
exit(EXIT_FAILURE);
187193
}
188194

0 commit comments

Comments
 (0)