Closed gwolf-011235 closed 1 month ago
Calls up memories of the struggles we had with the signal handling in minishell.
That reminds me: since we do use fork() for CGI, we would need to check which signal handler is registered, and if we need to change it. Also in case of sudden shutdown (aka interrupting the graceful shutdown - send signal two times) we would need to kill all spawned child processes. Something to keep in mind after CGI was added > should I open issue?
You tested it by trying out Ctrl+c and Ctrl+d?
Right now only SIGINT is registered, since it's easy to test (ctrl+c) Ctrl+d doesn't send a signal per se, it sends char EOF. Since we don't do input handling we don't care about it :D
Yes, please create an issue for this.
Yes, please create an issue for this.
Tracked as issue #60
Regarding which signals should be handled:
@u413-284-si found these resources:
where
Since we're not expected to daemonize our server (see the informative man daemon(7) ), I would suggest to not implement reloading of config. Even we do want, I would track it as extra issue and not implement it in this PR.
However I will implement
Updated with new functionality (in summary, additions marked with (NEW))
Summary (updated)
Summary was updated with new functionality: register specific signals; difference between quick and graceful shutdown. Additions marked with (NEW)
1. Signal handling
std::sig_atomic_t g_signalStatus
to the signal number2. Incorporate signal handling in server
3. Connection::Idle
4. serverShutdown function
5. Server::run > runServer(Server& server)
6. Remove toString