#include "color.h"
#include "version.h"
+__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
+
/** Define the array of error lists needed by para_server. */
INIT_SERVER_ERRLISTS;
init_user_list(user_list_file);
/* become daemon */
if (conf.daemon_given)
- daemonize();
+ daemonize(true /* parent waits for SIGTERM */);
PARA_NOTICE_LOG("initializing audio format handlers\n");
afh_init();
PARA_NOTICE_LOG("initializing virtual streaming system\n");
init_vss_task(afs_socket);
init_server_command_task(argc, argv);
+ if (conf.daemon_given)
+ kill(getppid(), SIGTERM);
PARA_NOTICE_LOG("server init complete\n");
}