mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
reboot: Ignore SIGTERM at halt/poweroff
We want to emulate the behavior of the reboot() syscall on success. Primarily for a coherency/symmetry, but also to prevent printing a new shell prompt in the middle of system shutdown messages. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
1550c34d65
commit
5cdbd57875
1 file changed
+8
@@ -85,6 +85,11 @@ static void transform(char *nm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sig(int signo)
|
||||||
|
{
|
||||||
|
(void)signo; /* NOP */
|
||||||
|
}
|
||||||
|
|
||||||
static int usage(int rc)
|
static int usage(int rc)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s [OPTIONS]\n\n"
|
fprintf(stderr, "Usage: %s [OPTIONS]\n\n"
|
||||||
@@ -144,6 +149,9 @@ int main(int argc, char *argv[])
|
|||||||
/* Check for any overrides */
|
/* Check for any overrides */
|
||||||
transform(NULL);
|
transform(NULL);
|
||||||
|
|
||||||
|
/* Catch and ignore SIGTERM on halt/poweroff */
|
||||||
|
signal(SIGTERM, sig);
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CMD_REBOOT:
|
case CMD_REBOOT:
|
||||||
|
|||||||
Reference in new issue
Block a user