OVS‘s ’default log is /var/log/openvswitch. If i construct the /var/log full ,ovsdb-server and ovs-vswitchd start failed.
because VLOG_OPTION_HANDLERS exit because vlog_set_log_faile exit with errno 1ENOSPC (No space left on device)
/* Sets the name of the log file used by VLF_FILE to 'file_name', or to the
* default file name if 'file_name' is null. Returns 0 if successful,
* otherwise a positive errno value. */
int
vlog_set_log_file(const char *file_name)
{
...
/* Open new log file and update min_levels[] to reflect whether we actually
* have a log_file. */
log_fd = open(log_file_name, O_WRONLY | O_CREAT | O_APPEND, 0666);
...
/* Log success or failure. */
if (log_fd < 0) {
VLOG_WARN("failed to open %s for logging: %s",
log_file_name, strerror(errno));
error = errno;
}
...
return error;
}
#define VLOG_OPTION_HANDLERS \
...
case OPT_LOG_FILE: { \
int err = vlog_set_log_file(optarg);\
/* Exit if logfile explicitly given \
* but cannot be opened. */ \
if (err && optarg) { \
exit(EXIT_FAILURE); \
} \
break; \
} \
...
I think this problem can be optimized. If OVS open log file failed, it continues to start. When /var/log has free space, OVS restore logging.
OVS‘s ’default log is /var/log/openvswitch. If i construct the /var/log full ,ovsdb-server and ovs-vswitchd start failed.![image](https://user-images.githubusercontent.com/23504706/174945330-6f4f6249-225f-4c50-9ee2-3a6985b096cb.png)
because
VLOG_OPTION_HANDLERS
exit becausevlog_set_log_faile
exit with errno1ENOSPC
(No space left on device)I think this problem can be optimized. If OVS open log file failed, it continues to start. When /var/log has free space, OVS restore logging.