This reverts commit
7a4b6d5f19976ceac581f6dc235fcbd9b30c767f, which
was a rather bad idea because it caused the afs process to inherit
the open file descriptor of the command socket, so two processes
listened on the command socket at the same time.
Even worse, the afs process also inherited the command task in its
scheduler setup, causing it to answer incoming connections as well.
In fact it was more or less random which of the two processes served
an incoming connection.
If it was the afs process, interesting things happened in the command
handler due to its address space being a copy of the afs process,
where parts of what is needed for some commands not properly set
up. For example the si and the sender commands segfaulted due to a
NULL pointer dereference.
It's weird that this bug was not noticed earlier.
gettimeofday(now, NULL);
set_server_start_time(now);
init_user_list(user_list_file);
- init_server_command_task(argc, argv);
/* become daemon */
if (conf.daemon_given)
daemonize();
para_unblock_signal(SIGCHLD);
PARA_NOTICE_LOG("initializing virtual streaming system\n");
init_vss_task(afs_socket);
+ init_server_command_task(argc, argv);
PARA_NOTICE_LOG("server init complete\n");
}