Don't fork the daemon, stay in the foreground.
.TP
.B -v|--verbose
-Display more log messages. This option can be used twice to enable more verbose log
-messages.
+Display more log messages. This option can be used three times to enable more
+verbose log messages.
.TP
.B -q|--quiet
-Display less log messages. This option can be used twice to enable even less log
-messages and to only log errors.
+Display less log messages.
.TP
.B -Q|--nolog
Disable logging.
.TP
.B -d|--debug
-Equivalent to '-nvvf -', i.e. don't fork the daemon, display all log messages and
+Equivalent to '-nvvvf -', i.e. don't fork the daemon, display all log messages and
write them to the standard output.
.TP
.B -u <user>|--socket-user=<user>
* Start logging. Opens syslog and/or log file and sets log level.
* @param logp Path of the log file, NULL if no log file was specified
* @param logf Syslog facility, NULL if no facility was specified
- * @param logv Log verbosity, 2 is the default, 0 = no logging, 4 = everything
+ * @param logv Log verbosity, 1 is the default, 0 = no logging, 4 = everything
*/
static void cgre_start_log(const char *logp, int logf, int logv)
{
/* Log levels */
int loglevels[] = {
- LOG_EMERG, /* -qq */
- LOG_ERR, /* -q */
- LOG_NOTICE, /* default */
- LOG_INFO, /* -v */
- LOG_DEBUG /* -vv */
+ LOG_EMERG, /* -q */
+ LOG_ERR, /* default */
+ LOG_WARNING, /* -v */
+ LOG_INFO, /* -vv */
+ LOG_DEBUG /* -vvv */
};
/* Set default logging destination if nothing was specified */
* @param logp Path of the log file, NULL if no log file was specified
* @param logf Syslog facility, 0 if no facility was specified
* @param daemon False to turn off daemon mode (no fork, leave FDs open)
- * @param logv Log verbosity, 2 is the default, 0 = no logging, 5 = everything
+ * @param logv Log verbosity, 1 is the default, 0 = no logging, 5 = everything
* @return 0 on success, > 0 on error
*/
int cgre_start_daemon(const char *logp, const int logf,
/* Current time */
time_t tm = time(0);
- flog(LOG_NOTICE, "Reloading rules configuration\n");
+ flog(LOG_INFO, "Reloading rules configuration\n");
flog(LOG_DEBUG, "Current time: %s\n", ctime(&tm));
/* Ask libcgroup to reload the rules table. */
/* Current time */
time_t tm = time(0);
- flog(LOG_NOTICE, "Reloading templates configuration.");
- flog(LOG_DEBUG, "Current time: %s", ctime(&tm));
+ flog(LOG_INFO, "Reloading templates configuration.\n");
+ flog(LOG_DEBUG, "Current time: %s\n", ctime(&tm));
/* Ask libcgroup to reload the templates table. */
cgroup_reload_cached_templates(CGCONFIG_CONF_FILE);
/* Current time */
time_t tm = time(0);
- flog(LOG_NOTICE, "Stopped CGroup Rules Engine Daemon at %s\n",
+ flog(LOG_INFO, "Stopped CGroup Rules Engine Daemon at %s\n",
ctime(&tm));
/* Close the log file, if we opened one */
int facility = 0;
/* Verbose level */
- int verbosity = 2;
+ int verbosity = 1;
/* For catching signals */
struct sigaction sa;
ret = sigaction(SIGUSR1, &sa, NULL);
if (ret) {
flog(LOG_ERR, "Failed to set up signal handler for SIGUSR1."\
- " Error: %s", strerror(errno));
+ " Error: %s\n", strerror(errno));
goto finished;
}
if (ret)
flog(LOG_WARNING, "Failed to initialize running tasks.\n");
- flog(LOG_NOTICE, "Started the CGroup Rules Engine Daemon.\n");
+ flog(LOG_INFO, "Started the CGroup Rules Engine Daemon.\n");
/* We loop endlesly in this function, unless we encounter an error. */
ret = cgre_create_netlink_socket_process_msg();