Merge pull request #1425 from jsorg71/sesman-startup

sesman: fix for sesman startup without startup script
This commit is contained in:
jsorg71 2019-10-17 20:54:22 -07:00 committed by GitHub
commit 04f885189a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 30 deletions

View File

@ -51,16 +51,6 @@ config_read(struct config_sesman *cfg)
if (-1 == fd) if (-1 == fd)
{ {
//if (g_cfg->log.fd >= 0)
//{
/* logging is already active */
log_message(LOG_LEVEL_ALWAYS, "error opening %s in \
config_read", cfg_file);
//}
//else
//{
g_printf("error opening %s in config_read", cfg_file);
//}
return 1; return 1;
} }
@ -212,15 +202,6 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
g_free(buf); g_free(buf);
} }
log_message(LOG_LEVEL_TRACE, "config loaded in %s at %s:%d", __func__, __FILE__, __LINE__);
log_message(LOG_LEVEL_TRACE, " listen_address = %s", cf->listen_address);
log_message(LOG_LEVEL_TRACE, " listen_port = %s", cf->listen_port);
log_message(LOG_LEVEL_TRACE, " enable_user_wm = %d", cf->enable_user_wm);
log_message(LOG_LEVEL_TRACE, " default_wm = %s", cf->default_wm);
log_message(LOG_LEVEL_TRACE, " user_wm = %s", cf->user_wm);
log_message(LOG_LEVEL_TRACE, " reconnect_sh = %s", cf->reconnect_sh);
log_message(LOG_LEVEL_TRACE, " auth_file_path = %s", cf->auth_file_path);
return 0; return 0;
} }

View File

@ -342,12 +342,33 @@ main(int argc, char **argv)
g_exit(1); g_exit(1);
} }
log_message(LOG_LEVEL_TRACE, "config loaded in %s at %s:%d", __func__, __FILE__, __LINE__);
log_message(LOG_LEVEL_TRACE, " listen_address = %s", g_cfg->listen_address);
log_message(LOG_LEVEL_TRACE, " listen_port = %s", g_cfg->listen_port);
log_message(LOG_LEVEL_TRACE, " enable_user_wm = %d", g_cfg->enable_user_wm);
log_message(LOG_LEVEL_TRACE, " default_wm = %s", g_cfg->default_wm);
log_message(LOG_LEVEL_TRACE, " user_wm = %s", g_cfg->user_wm);
log_message(LOG_LEVEL_TRACE, " reconnect_sh = %s", g_cfg->reconnect_sh);
log_message(LOG_LEVEL_TRACE, " auth_file_path = %s", g_cfg->auth_file_path);
if (daemon) if (daemon)
{ {
/* not to spit on the console, shut up stdout/stderr before anything's logged */ /* not to spit on the console, shut up stdout/stderr before anything's logged */
g_file_close(0); g_file_close(0);
g_file_close(1); g_file_close(1);
g_file_close(2); g_file_close(2);
if (g_file_open("/dev/null") < 0)
{
}
if (g_file_open("/dev/null") < 0)
{
}
if (g_file_open("/dev/null") < 0)
{
}
} }
/* libscp initialization */ /* libscp initialization */
@ -372,17 +393,6 @@ main(int argc, char **argv)
g_exit(0); g_exit(0);
} }
if (g_file_open("/dev/null") < 0)
{
}
if (g_file_open("/dev/null") < 0)
{
}
if (g_file_open("/dev/null") < 0)
{
}
} }
/* signal handling */ /* signal handling */