}
ut = uptime_str();
ret = send_va_buffer(fd, "up: %s\nplayed: %u\n"
- "pid: %d\n"
+ "server_pid: %d\n"
+ "afs_pid: %d\n"
"connections (active/accepted/total): %u/%u/%u\n"
"current loglevel: %i\n"
"supported audio formats: %s\n"
"%s",
ut, mmd->num_played,
(int)getppid(),
+ (int)mmd->afs_pid,
mmd->active_connections,
mmd->num_commands,
mmd->num_connects,
/** The file containing user information (public key, permissions). */
static char *user_list_file = NULL;
static int mmd_shm_id;
-static pid_t afs_pid;
/** The task responsible for server command handling. */
logfile = NULL;
parse_config(1); /* reopens log */
init_user_list(user_list_file); /* reload user list */
- if (afs_pid)
- kill(afs_pid, SIGHUP);
+ if (mmd->afs_pid)
+ kill(mmd->afs_pid, SIGHUP);
}
static void signal_post_select(struct sched *s, struct task *t)
int ret = para_reap_child(&pid);
if (ret <= 0)
break;
- if (pid != afs_pid)
+ if (pid != mmd->afs_pid)
continue;
PARA_EMERG_LOG("fatal: afs died\n");
goto genocide;
if (ret < 0)
exit(EXIT_FAILURE);
afs_socket_cookie = para_random((uint32_t)-1);
- afs_pid = fork();
- if (afs_pid < 0)
+ mmd->afs_pid = fork();
+ if (mmd->afs_pid < 0)
exit(EXIT_FAILURE);
- if (!afs_pid) { /* child (afs) */
+ if (!mmd->afs_pid) { /* child (afs) */
close(afs_server_socket[0]);
afs_init(afs_socket_cookie, afs_server_socket[1]);
}
daemon_init();
PARA_NOTICE_LOG("initializing audio format handlers\n");
afh_init();
- mmd->server_pid = getpid();
init_signal_task();
PARA_NOTICE_LOG("initializing the audio file selector\n");
afs_socket = init_afs();
unsigned int num_connects;
/** The number of connections currently active. */
unsigned int active_connections;
- /** The process id of para_server. */
- pid_t server_pid;
+ /** The process id of the audio file selector. */
+ pid_t afs_pid;
/** This gets updated by afs and contains its current mode. */
char afs_mode_string[MAXLINE];
/** Used by the sender command. */