0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-04 11:08:55 +02:00

construct: Remove SIGTSTP related stuff; minor cleanup.

This commit is contained in:
Jason Volk 2018-05-07 19:21:21 -07:00
parent 024912d072
commit 7bf9736a23
3 changed files with 4 additions and 82 deletions

View file

@ -34,13 +34,6 @@ A `ctrl-c` to Construct will bring up the command line console interface. It
will not halt the daemon. Log messages will be suppressed while the console
is waiting for input, but service is still continuing in the background.
##### SIGTSTP
A `ctrl-z` or "Terminal SToP" to Construct will bring up the command line
console like with `SIGINT` except that the entire daemon will pause while
waiting for console input. When paused, a second `SIGTSTP` will exhibit default
behavior so your shell can offer its functionality here.
##### SIGHUP
A "HangUP" to Construct is only relevant to the command line console, and

View file

@ -155,60 +155,6 @@ catch(const std::exception &e)
};
}
const char *const termstop_message
{R"(
***
*** The server has been paused and will resume when you hit enter.
*** This is a client and your commands will originate from the server itself.
***)"};
static void
_console_termstop()
try
{
const unwind atexit([]
{
console_fini();
});
console_init();
std::cout << termstop_message << generic_message;
std::string line;
std::cout << "\n> " << std::flush;
std::getline(std::cin, line);
if(std::cin.eof())
{
std::cout << std::endl;
std::cin.clear();
return;
}
handle_line(line);
}
catch(const std::exception &e)
{
ircd::log::error
{
"console_termstop(): %s", e.what()
};
}
void
console_termstop()
{
if(ctx::current)
return _console_termstop();
ircd::context
{
"console",
stack_sz,
_console_termstop,
ircd::context::DETACH
};
}
void
execute(const std::vector<std::string> lines)
try

View file

@ -175,7 +175,8 @@ catch(const std::exception &e)
return EXIT_FAILURE;
}
void print_version()
void
print_version()
{
printf("VERSION :%s\n",
RB_VERSION);
@ -187,7 +188,8 @@ void print_version()
#endif
}
bool startup_checks()
bool
startup_checks()
try
{
#ifndef _WIN32
@ -232,7 +234,6 @@ enable_coredumps()
static bool handle_quit();
static bool handle_interruption();
static bool handle_termstop();
static bool handle_hangup();
static bool handle(const int &signum);
@ -269,7 +270,6 @@ handle(const int &signum)
switch(signum)
{
case SIGINT: return handle_interruption();
case SIGTSTP: return handle_termstop();
case SIGHUP: return handle_hangup();
case SIGQUIT: return handle_quit();
case SIGTERM: return handle_quit();
@ -312,23 +312,6 @@ catch(const std::exception &e)
return true;
}
bool
handle_termstop()
try
{
console_termstop();
return true;
}
catch(const std::exception &e)
{
ircd::log::error
{
"SIGTSTP handler: %s", e.what()
};
return true;
}
bool
handle_interruption()
try