Преглед на файлове

Improve CLI error message for write permission failures

Joseph Henry преди 1 година
родител
ревизия
1f4c00c7b5
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      service/OneService.cpp

+ 2 - 2
service/OneService.cpp

@@ -977,7 +977,7 @@ public:
 					if (!OSUtils::writeFile(authTokenPath.c_str(),_authToken)) {
 					if (!OSUtils::writeFile(authTokenPath.c_str(),_authToken)) {
 						Mutex::Lock _l(_termReason_m);
 						Mutex::Lock _l(_termReason_m);
 						_termReason = ONE_UNRECOVERABLE_ERROR;
 						_termReason = ONE_UNRECOVERABLE_ERROR;
-						_fatalErrorMessage = "authtoken.secret could not be written";
+						_fatalErrorMessage = "authtoken.secret could not be written (try running with -U to prevent dropping of privileges)";
 						return _termReason;
 						return _termReason;
 					} else {
 					} else {
 						OSUtils::lockDownFile(authTokenPath.c_str(),false);
 						OSUtils::lockDownFile(authTokenPath.c_str(),false);
@@ -997,7 +997,7 @@ public:
 					if (!OSUtils::writeFile(metricsTokenPath.c_str(),_metricsToken)) {
 					if (!OSUtils::writeFile(metricsTokenPath.c_str(),_metricsToken)) {
 						Mutex::Lock _l(_termReason_m);
 						Mutex::Lock _l(_termReason_m);
 						_termReason = ONE_UNRECOVERABLE_ERROR;
 						_termReason = ONE_UNRECOVERABLE_ERROR;
-						_fatalErrorMessage = "metricstoken.secret could not be written";
+						_fatalErrorMessage = "metricstoken.secret could not be written (try running with -U to prevent dropping of privileges)";
 						return _termReason;
 						return _termReason;
 					} else {
 					} else {
 						OSUtils::lockDownFile(metricsTokenPath.c_str(),false);
 						OSUtils::lockDownFile(metricsTokenPath.c_str(),false);