Browse Source

Make capitalisation of error messages more consistent

Davin McCall 3 years ago
parent
commit
4b5ed5611e

+ 8 - 8
src/baseproc-service.cc

@@ -175,7 +175,7 @@ bool base_process_service::start_ps_process(const std::vector<const char *> &cmd
         reserved_child_watch = true;
     }
     catch (std::exception &e) {
-        log(loglevel_t::ERROR, get_name(), ": Could not fork: ", e.what());
+        log(loglevel_t::ERROR, get_name(), ": could not fork: ", e.what());
         goto out_cs_h;
     }
 
@@ -417,13 +417,13 @@ bool base_process_service::open_socket() noexcept
     if (stat(saddrname, &stat_buf) == 0) {
         if ((stat_buf.st_mode & S_IFSOCK) == 0) {
             // Not a socket
-            log(loglevel_t::ERROR, get_name(), ": Activation socket file exists (and is not a socket)");
+            log(loglevel_t::ERROR, get_name(), ": activation socket file exists (and is not a socket)");
             return false;
         }
     }
     else if (errno != ENOENT) {
         // Other error
-        log(loglevel_t::ERROR, get_name(), ": Error checking activation socket: ", strerror(errno));
+        log(loglevel_t::ERROR, get_name(), ": error checking activation socket: ", strerror(errno));
         return false;
     }
 
@@ -435,7 +435,7 @@ bool base_process_service::open_socket() noexcept
     uint sockaddr_size = offsetof(struct sockaddr_un, sun_path) + socket_path.length() + 1;
     struct sockaddr_un * name = static_cast<sockaddr_un *>(malloc(sockaddr_size));
     if (name == nullptr) {
-        log(loglevel_t::ERROR, get_name(), ": Opening activation socket: out of memory");
+        log(loglevel_t::ERROR, get_name(), ": opening activation socket: out of memory");
         return false;
     }
 
@@ -444,13 +444,13 @@ bool base_process_service::open_socket() noexcept
 
     int sockfd = dinit_socket(AF_UNIX, SOCK_STREAM, 0, SOCK_NONBLOCK | SOCK_CLOEXEC);
     if (sockfd == -1) {
-        log(loglevel_t::ERROR, get_name(), ": Error creating activation socket: ", strerror(errno));
+        log(loglevel_t::ERROR, get_name(), ": error creating activation socket: ", strerror(errno));
         free(name);
         return false;
     }
 
     if (bind(sockfd, (struct sockaddr *) name, sockaddr_size) == -1) {
-        log(loglevel_t::ERROR, get_name(), ": Error binding activation socket: ", strerror(errno));
+        log(loglevel_t::ERROR, get_name(), ": error binding activation socket: ", strerror(errno));
         close(sockfd);
         free(name);
         return false;
@@ -461,7 +461,7 @@ bool base_process_service::open_socket() noexcept
     // POSIX (1003.1, 2013) says that fchown and fchmod don't necessarily work on sockets. We have to
     // use chown and chmod instead.
     if (chown(saddrname, socket_uid, socket_gid)) {
-        log(loglevel_t::ERROR, get_name(), ": Error setting activation socket owner/group: ",
+        log(loglevel_t::ERROR, get_name(), ": error setting activation socket owner/group: ",
                 strerror(errno));
         close(sockfd);
         return false;
@@ -475,7 +475,7 @@ bool base_process_service::open_socket() noexcept
     }
 
     if (listen(sockfd, 128) == -1) { // 128 "seems reasonable".
-        log(loglevel_t::ERROR, ": Error listening on activation socket: ", strerror(errno));
+        log(loglevel_t::ERROR, ": error listening on activation socket: ", strerror(errno));
         close(sockfd);
         return false;
     }

+ 1 - 1
src/dinit-main.cc

@@ -12,7 +12,7 @@ int main(int argc, char **argv)
         return dinit_main(argc, argv);
     }
     catch (std::bad_alloc &badalloc) {
-        std::cout << "dinit: Out-of-memory during initialisation" << std::endl;
+        std::cout << "dinit: out-of-memory during initialisation" << std::endl;
         return 1;
     }
     catch (std::system_error &syserr) {

+ 4 - 4
src/dinit.cc

@@ -282,7 +282,7 @@ int dinit_main(int argc, char **argv)
                 else {
                     // unrecognized
                     if (! am_system_init) {
-                        cerr << "dinit: Unrecognized option: " << argv[i] << endl;
+                        cerr << "dinit: unrecognized option: " << argv[i] << endl;
                         return 1;
                     }
                 }
@@ -429,7 +429,7 @@ int dinit_main(int argc, char **argv)
             // exit if user process).
         }
         catch (service_not_found &snf) {
-            log(loglevel_t::ERROR, snf.service_name, ": Could not find service description.");
+            log(loglevel_t::ERROR, snf.service_name, ": could not find service description.");
         }
         catch (service_load_exc &sle) {
             log(loglevel_t::ERROR, sle.service_name, ": ", sle.exc_description);
@@ -529,7 +529,7 @@ int dinit_main(int argc, char **argv)
 // Log a parse error when reading the environment file.
 static void log_bad_env(int linenum)
 {
-    log(loglevel_t::ERROR, "invalid environment variable setting in environment file (line ", linenum, ")");
+    log(loglevel_t::ERROR, "Invalid environment variable setting in environment file (line ", linenum, ")");
 }
 
 // Read and set environment variables from a file. May throw std::bad_alloc, std::system_error.
@@ -670,7 +670,7 @@ static void control_socket_cb(eventloop_t *loop, int sockfd)
             new control_conn_t(*loop, services, newfd);  // will delete itself when it's finished
         }
         catch (std::exception &exc) {
-            log(loglevel_t::ERROR, "Accepting control connection: ", exc.what());
+            log(loglevel_t::ERROR, "Error accepting control connection: ", exc.what());
             close(newfd);
         }
     }

+ 1 - 1
src/dinitcheck.cc

@@ -333,7 +333,7 @@ service_record *load_service(service_set_t &services, const std::string &name,
     catch (std::system_error &sys_err)
     {
         report_error(sys_err, name);
-        throw service_description_exc(name, "Error while reading service description.");
+        throw service_description_exc(name, "error while reading service description.");
     }
 
     auto report_err = [&](const char *msg) {

+ 19 - 19
src/dinitctl.cc

@@ -320,7 +320,7 @@ int main(int argc, char **argv)
                 control_socket_path = control_socket_str.c_str();
             }
             else {
-                cerr << "dinitctl: Cannot locate user home directory (set HOME, check /etc/passwd file, or "
+                cerr << "dinitctl: cannot locate user home directory (set HOME, check /etc/passwd file, or "
                         "specify socket path via -p)" << endl;
                 return 1;
             }
@@ -337,7 +337,7 @@ int main(int argc, char **argv)
     uint sockaddr_size = offsetof(struct sockaddr_un, sun_path) + strlen(control_socket_path) + 1;
     name = (struct sockaddr_un *) malloc(sockaddr_size);
     if (name == nullptr) {
-        cerr << "dinitctl: Out of memory" << endl;
+        cerr << "dinitctl: out of memory" << endl;
         return 1;
     }
     
@@ -577,7 +577,7 @@ static int start_stop_service(int socknum, cpbuffer_t &rbuffer, const char *serv
         if (reply_pkt_h == DINIT_RP_DEPENDENTS && pcommand == DINIT_CP_STOPSERVICE) {
             cerr << "dinitctl: cannot stop service '" << service_name << "' due to the following dependents:\n";
             if (command != command_t::RESTART_SERVICE) {
-                cerr << "(Only direct dependents are listed. Exercise caution before using '--force' !!)\n";
+                cerr << "(only direct dependents are listed. Exercise caution before using '--force' !!)\n";
             }
             // size_t number, N * handle_t handles
             size_t number;
@@ -796,12 +796,12 @@ static int unload_service(int socknum, cpbuffer_t &rbuffer, const char *service_
 
         wait_for_reply(rbuffer, socknum);
         if (rbuffer[0] == DINIT_RP_NAK) {
-            cerr << "dinitctl: Could not unload service; service not stopped, or is a dependency of "
+            cerr << "dinitctl: could not unload service; service not stopped, or is a dependency of "
                     "other service." << endl;
             return 1;
         }
         if (rbuffer[0] != DINIT_RP_ACK) {
-            cerr << "dinitctl: Protocol error." << endl;
+            cerr << "dinitctl: protocol error." << endl;
             return 1;
         }
         rbuffer.consume(1);
@@ -843,12 +843,12 @@ static int reload_service(int socknum, cpbuffer_t &rbuffer, const char *service_
 
         wait_for_reply(rbuffer, socknum);
         if (rbuffer[0] == DINIT_RP_NAK) {
-            cerr << "dinitctl: Could not reload service; service in wrong state, incompatible change, "
+            cerr << "dinitctl: could not reload service; service in wrong state, incompatible change, "
                     "or bad service description." << endl;
             return 1;
         }
         if (rbuffer[0] != DINIT_RP_ACK) {
-            cerr << "dinitctl: Protocol error." << endl;
+            cerr << "dinitctl: protocol error." << endl;
             return 1;
         }
         rbuffer.consume(1);
@@ -966,7 +966,7 @@ static int list_services(int socknum, cpbuffer_t &rbuffer)
     }
 
     if (rbuffer[0] != DINIT_RP_LISTDONE) {
-        cerr << "dinitctl: Control socket protocol error" << endl;
+        cerr << "dinitctl: control socket protocol error" << endl;
         return 1;
     }
 
@@ -987,7 +987,7 @@ static int add_remove_dependency(int socknum, cpbuffer_t &rbuffer, bool add,
     }
 
     if (from_handle == to_handle) {
-        cerr << "dinitctl: Can not add/remove a dependency from a service to itself" << endl;
+        cerr << "dinitctl: can not add/remove a dependency from a service to itself" << endl;
         return 1;
     }
 
@@ -1002,11 +1002,11 @@ static int add_remove_dependency(int socknum, cpbuffer_t &rbuffer, bool add,
 
     // check reply
     if (rbuffer[0] == DINIT_RP_NAK) {
-        cerr << "dinitctl: Could not add dependency: circular dependency or wrong state" << endl;
+        cerr << "dinitctl: could not add dependency: circular dependency or wrong state" << endl;
         return 1;
     }
     if (rbuffer[0] != DINIT_RP_ACK) {
-        cerr << "dinitctl: Control socket protocol error" << endl;
+        cerr << "dinitctl: control socket protocol error" << endl;
         return 1;
     }
 
@@ -1026,7 +1026,7 @@ static int shutdown_dinit(int socknum, cpbuffer_t &rbuffer)
     wait_for_reply(rbuffer, socknum);
 
     if (rbuffer[0] != DINIT_RP_ACK) {
-        cerr << "dinitctl: Control socket protocol error" << endl;
+        cerr << "dinitctl: control socket protocol error" << endl;
         return 1;
     }
 
@@ -1069,7 +1069,7 @@ static int enable_disable_service(int socknum, cpbuffer_t &rbuffer, const char *
     wait_for_reply(rbuffer, socknum);
 
     if (rbuffer[0] != DINIT_RP_LOADER_MECH) {
-        cerr << "dinitctl: Control socket protocol error" << endl;
+        cerr << "dinitctl: control socket protocol error" << endl;
         return 1;
     }
 
@@ -1206,28 +1206,28 @@ static int enable_disable_service(int socknum, cpbuffer_t &rbuffer, const char *
 
     // check reply
     if (enable && rbuffer[0] == DINIT_RP_NAK) {
-        cerr << "dinitctl: Could not enable service: possible circular dependency" << endl;
+        cerr << "dinitctl: could not enable service: possible circular dependency" << endl;
         return 1;
     }
     if (rbuffer[0] != DINIT_RP_ACK) {
-        cerr << "dinitctl: Control socket protocol error" << endl;
+        cerr << "dinitctl: control socket protocol error" << endl;
         return 1;
     }
 
     // create link
     if (enable) {
         if (symlink((string("../") + to).c_str(), dep_link_path.c_str()) == -1) {
-            cerr << "dinitctl: Could not create symlink at " << dep_link_path << ": " << strerror(errno)
-                    << "\n" "dinitctl: Note: service was activated, but will not be enabled on restart."
+            cerr << "dinitctl: could not create symlink at " << dep_link_path << ": " << strerror(errno)
+                    << "\n" "dinitctl: note: service was activated, but will not be enabled on restart."
                     << endl;
             return 1;
         }
     }
     else {
         if (unlink(dep_link_path.c_str()) == -1) {
-            cerr << "dinitctl: Could not unlink dependency entry " << dep_link_path << ": "
+            cerr << "dinitctl: could not unlink dependency entry " << dep_link_path << ": "
                     << strerror(errno) << "\n"
-                    "dinitctl: Note: service was disabled, but will be re-enabled on restart." << endl;
+                    "dinitctl: note: service was disabled, but will be re-enabled on restart." << endl;
             return 1;
         }
     }

+ 4 - 4
src/igr-tests/check-basic/expected.txt

@@ -1,7 +1,7 @@
 Checking service: boot...
-Service 'boot': Unknown setting: 'not-valid'.
-Service 'boot': run-as: Specified user id contains invalid numeric characters or is outside allowed range.
-Service 'boot': Service command not specified.
+Service 'boot': unknown setting: 'not-valid'.
+Service 'boot': run-as: specified user id contains invalid numeric characters or is outside allowed range.
+Service 'boot': service command not specified.
 Checking service: test1...
-Unable to load service 'test1': Service description not found.
+Unable to load service 'test1': service description not found.
 One or more errors found.

+ 1 - 1
src/igr-tests/force-stop/expected-2.err

@@ -1,3 +1,3 @@
 dinitctl: cannot stop service 'critical' due to the following dependents:
-(Only direct dependents are listed. Exercise caution before using '--force' !!)
+(only direct dependents are listed. Exercise caution before using '--force' !!)
   intermediary boot

+ 1 - 1
src/igr-tests/no-command-error/dinit-run.expected

@@ -1 +1 @@
-dinit: no-command: Service command not specified.
+dinit: no-command: service command not specified.

+ 1 - 1
src/igr-tests/reload1/output2.expected

@@ -1 +1 @@
-dinitctl: Could not reload service; service in wrong state, incompatible change, or bad service description.
+dinitctl: could not reload service; service in wrong state, incompatible change, or bad service description.

+ 31 - 31
src/includes/load-service.h

@@ -68,7 +68,7 @@ class service_not_found : public service_load_exc
 {
     public:
     service_not_found(const std::string &serviceName) noexcept
-        : service_load_exc(serviceName, "Service description not found.")
+        : service_load_exc(serviceName, "service description not found.")
     {
     }
 };
@@ -77,7 +77,7 @@ class service_cyclic_dependency : public service_load_exc
 {
     public:
     service_cyclic_dependency(const std::string &serviceName) noexcept
-        : service_load_exc(serviceName, "Has cyclic dependency.")
+        : service_load_exc(serviceName, "has cyclic dependency.")
     {
     }
 };
@@ -214,7 +214,7 @@ inline string read_setting_value(string_iterator & i, string_iterator end,
                         rval += c;
                     }
                     else {
-                        throw setting_exception("Line end follows backslash escape character (`\\')");
+                        throw setting_exception("line end follows backslash escape character (`\\')");
                     }
                 }
                 else {
@@ -224,7 +224,7 @@ inline string read_setting_value(string_iterator & i, string_iterator end,
             }
             if (i == end) {
                 // String wasn't terminated
-                throw setting_exception("Unterminated quoted string");
+                throw setting_exception("unterminated quoted string");
             }
         }
         else if (c == '\\') {
@@ -238,7 +238,7 @@ inline string read_setting_value(string_iterator & i, string_iterator end,
                 rval += *i;
             }
             else {
-                throw setting_exception("Backslash escape (`\\') not followed by character");
+                throw setting_exception("backslash escape (`\\') not followed by character");
             }
         }
         else if (isspace(c, locale::classic())) {
@@ -281,7 +281,7 @@ inline string read_setting_value(string_iterator & i, string_iterator end,
 // it is not null.
 inline uid_t parse_uid_param(const std::string &param, const std::string &service_name, const char *setting_name, gid_t *group_p)
 {
-    const char * uid_err_msg = "Specified user id contains invalid numeric characters "
+    const char * uid_err_msg = "specified user id contains invalid numeric characters "
             "or is outside allowed range.";
 
     // Could be a name or a numeric id. But we should assume numeric first, just in case
@@ -313,11 +313,11 @@ inline uid_t parse_uid_param(const std::string &param, const std::string &servic
     if (pwent == nullptr) {
         // Maybe an error, maybe just no entry.
         if (errno == 0) {
-            throw service_description_exc(service_name, std::string(setting_name) + ": Specified user \"" + param
+            throw service_description_exc(service_name, std::string(setting_name) + ": specified user \"" + param
                     + "\" does not exist in system database.");
         }
         else {
-            throw service_description_exc(service_name, std::string("Error accessing user database: ")
+            throw service_description_exc(service_name, std::string("error accessing user database: ")
                     + strerror(errno));
         }
     }
@@ -331,7 +331,7 @@ inline uid_t parse_uid_param(const std::string &param, const std::string &servic
 
 inline gid_t parse_gid_param(const std::string &param, const char *setting_name, const std::string &service_name)
 {
-    const char * gid_err_msg = "Specified group id contains invalid numeric characters or is "
+    const char * gid_err_msg = "specified group id contains invalid numeric characters or is "
             "outside allowed range.";
 
     // Could be a name or a numeric id. But we should assume numeric first, just in case
@@ -363,11 +363,11 @@ inline gid_t parse_gid_param(const std::string &param, const char *setting_name,
     if (grent == nullptr) {
         // Maybe an error, maybe just no entry.
         if (errno == 0) {
-            throw service_description_exc(service_name, std::string(setting_name) + ": Specified group \"" + param
+            throw service_description_exc(service_name, std::string(setting_name) + ": specified group \"" + param
                     + "\" does not exist in system database.");
         }
         else {
-            throw service_description_exc(service_name, std::string("Error accessing group database: ")
+            throw service_description_exc(service_name, std::string("error accessing group database: ")
                     + strerror(errno));
         }
     }
@@ -392,11 +392,11 @@ inline void parse_timespec(const std::string &paramval, const std::string &servi
             break;
         }
         if (ch < '0' || ch > '9') {
-            throw service_description_exc(servicename, std::string("Bad value for ") + paramname);
+            throw service_description_exc(servicename, std::string("bad value for ") + paramname);
         }
         // check for overflow
         if (isec >= max_secs) {
-           throw service_description_exc(servicename, std::string("Too-large value for ") + paramname);
+           throw service_description_exc(servicename, std::string("too-large value for ") + paramname);
         }
         isec *= 10;
         isec += ch - '0';
@@ -405,7 +405,7 @@ inline void parse_timespec(const std::string &paramval, const std::string &servi
     for ( ; i < len; i++) {
         char ch = paramval[i];
         if (ch < '0' || ch > '9') {
-            throw service_description_exc(servicename, std::string("Bad value for ") + paramname);
+            throw service_description_exc(servicename, std::string("bad value for ") + paramname);
         }
         insec += (ch - '0') * insec_m;
         insec_m /= 10;
@@ -418,7 +418,7 @@ inline void parse_timespec(const std::string &paramval, const std::string &servi
 inline unsigned long long parse_unum_param(const std::string &param, const std::string &service_name,
         unsigned long long max = std::numeric_limits<unsigned long long>::max())
 {
-    const char * num_err_msg = "Specified value contains invalid numeric characters or is outside "
+    const char * num_err_msg = "specified value contains invalid numeric characters or is outside "
             "allowed range.";
 
     std::size_t ind = 0;
@@ -461,7 +461,7 @@ inline void parse_rlimit(const std::string &line, const std::string &service_nam
     // 4     soft and hard limit set to same limit
 
     if (line.empty()) {
-        throw service_description_exc(service_name, std::string(param_name) + ": Bad value.");
+        throw service_description_exc(service_name, std::string(param_name) + ": bad value.");
     }
 
     const char *cline = line.c_str();
@@ -492,7 +492,7 @@ inline void parse_rlimit(const std::string &line, const std::string &service_nam
             }
 
             if (*index != ':') {
-                throw service_description_exc(service_name, std::string(param_name) + ": Bad value.");
+                throw service_description_exc(service_name, std::string(param_name) + ": bad value.");
             }
         }
 
@@ -502,7 +502,7 @@ inline void parse_rlimit(const std::string &line, const std::string &service_nam
         if (*index == '-') {
             rlimit.limits.rlim_max = RLIM_INFINITY;
             if (index[1] != 0) {
-                throw service_description_exc(service_name, std::string(param_name) + ": Bad value.");
+                throw service_description_exc(service_name, std::string(param_name) + ": bad value.");
             }
         }
         else {
@@ -516,10 +516,10 @@ inline void parse_rlimit(const std::string &line, const std::string &service_nam
         }
     }
     catch (std::invalid_argument &exc) {
-        throw service_description_exc(service_name, std::string(param_name) + ": Bad value.");
+        throw service_description_exc(service_name, std::string(param_name) + ": bad value.");
     }
     catch (std::out_of_range &exc) {
-        throw service_description_exc(service_name, std::string(param_name) + ": Too-large value.");
+        throw service_description_exc(service_name, std::string(param_name) + ": too-large value.");
     }
 }
 
@@ -552,7 +552,7 @@ void process_service_file(string name, std::istream &service_file, T func)
             string setting = read_setting_name(i, end);
             i = skipws(i, end);
             if (i == end || (*i != '=' && *i != ':')) {
-                throw service_description_exc(name, "Badly formed line.");
+                throw service_description_exc(name, "badly formed line.");
             }
             i = skipws(++i, end);
 
@@ -623,17 +623,17 @@ class service_settings_wrapper
         if (service_type == service_type_t::PROCESS || service_type == service_type_t::BGPROCESS
                 || service_type == service_type_t::SCRIPTED) {
             if (command.length() == 0) {
-                report_error("Service command not specified.");
+                report_error("service command not specified.");
             }
         }
 
         if (service_type == service_type_t::BGPROCESS) {
             if (pid_file.empty()) {
-                report_error("Process ID file ('pid-file') not specified for bgprocess service.");
+                report_error("process ID file ('pid-file') not specified for bgprocess service.");
             }
 
             if (readiness_fd != -1 || !readiness_var.empty()) {
-                report_error("Readiness notification ('ready-notification') is not supported "
+                report_error("readiness notification ('ready-notification') is not supported "
                         "for bgprocess services.");
             }
         }
@@ -698,7 +698,7 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
             }
         }
         catch (std::logic_error &exc) {
-            throw service_description_exc(name, "socket-permissions: Badly-formed or "
+            throw service_description_exc(name, "socket-permissions: badly-formed or "
                     "out-of-range numeric value");
         }
     }
@@ -758,7 +758,7 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
             settings.service_type = service_type_t::INTERNAL;
         }
         else {
-            throw service_description_exc(name, "Service type must be one of: \"scripted\","
+            throw service_description_exc(name, "service type must be one of: \"scripted\","
                 " \"process\", \"bgprocess\" or \"internal\"");
         }
     }
@@ -823,7 +823,7 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
                 settings.do_sub_vars = false;
             }
             else {
-                throw service_description_exc(name, "Unknown load option: " + option_txt);
+                throw service_description_exc(name, "unknown load option: " + option_txt);
             }
         }
     }
@@ -832,7 +832,7 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
         string signame = read_setting_value(i, end, nullptr);
         int signo = signal_name_to_number(signame);
         if (signo == -1) {
-            throw service_description_exc(name, "Unknown/unsupported termination signal: "
+            throw service_description_exc(name, "unknown/unsupported termination signal: "
                     + signame);
         }
         else {
@@ -875,12 +875,12 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
         else if (starts_with(notify_setting, "pipevar:")) {
             settings.readiness_var = notify_setting.substr(8 /* len 'pipevar:' */);
             if (settings.readiness_var.empty()) {
-                throw service_description_exc(name, "Invalid pipevar variable name "
+                throw service_description_exc(name, "invalid pipevar variable name "
                         "in ready-notification");
             }
         }
         else {
-            throw service_description_exc(name, "Unknown ready-notification setting: "
+            throw service_description_exc(name, "unknown ready-notification setting: "
                     + notify_setting);
         }
     }
@@ -925,7 +925,7 @@ void process_service_line(settings_wrapper &settings, const char *name, string &
         #endif
     }
     else {
-        throw service_description_exc(name, "Unknown setting: '" + setting + "'.");
+        throw service_description_exc(name, "unknown setting: '" + setting + "'.");
     }
 }
 

+ 5 - 5
src/load-service.cc

@@ -316,12 +316,12 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv
             if (service->get_state() != service_state_t::STOPPED) {
                 // Can not change type of a running service.
                 if (service_type != service->get_type()) {
-                    throw service_description_exc(name, "Cannot change type of non-stopped service.");
+                    throw service_description_exc(name, "cannot change type of non-stopped service.");
                 }
                 // Can not alter a starting/stopping service, at least for now.
                 if (service->get_state() != service_state_t::STARTED) {
                     throw service_description_exc(name,
-                            "Cannot alter settings for service which is currently starting/stopping.");
+                            "cannot alter settings for service which is currently starting/stopping.");
                 }
 
                 // Check validity of dependencies (if started, regular deps must be started)
@@ -339,7 +339,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv
                 auto current_flags = service->get_flags();
                 if (current_flags.starts_on_console != settings.onstart_flags.starts_on_console
                         || current_flags.shares_console != settings.onstart_flags.shares_console) {
-                    throw service_description_exc(name, "Cannot change starts_on_console/"
+                    throw service_description_exc(name, "cannot change starts_on_console/"
                             "shares_console flags for a running service.");
                 }
 
@@ -347,7 +347,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv
                 if (service->get_type() == service_type_t::BGPROCESS) {
                     auto *bgp_service = static_cast<bgproc_service *>(service);
                     if (bgp_service->get_pid_file() != settings.pid_file) {
-                        throw service_description_exc(name, "Cannot change pid_file for running service.");
+                        throw service_description_exc(name, "cannot change pid_file for running service.");
                     }
                 }
 
@@ -360,7 +360,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv
                         if (strncmp(svc_utmp_id, settings.inittab_id, proc_service->get_utmp_id_size()) != 0
                                 || strncmp(svc_utmp_ln, settings.inittab_line,
                                         proc_service->get_utmp_line_size()) != 0) {
-                            throw service_description_exc(name, "Cannot change inittab-id or inittab-line "
+                            throw service_description_exc(name, "cannot change inittab-id or inittab-line "
                                     "settings for running service.");
                         }
                     }