diff options
| author | Warner Losh <imp@FreeBSD.org> | 2017-10-25 15:30:40 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2017-10-25 15:30:40 +0000 |
| commit | 35c1d16e3effdcda887a23086532cb81cd346643 (patch) | |
| tree | 164c137400590687775d367445e0a389fb55890e /sbin/init | |
| parent | 7d7d9013f1fd4bba8a6993ae09e18c1a56c99373 (diff) | |
Notes
Diffstat (limited to 'sbin/init')
| -rw-r--r-- | sbin/init/init.8 | 1 | ||||
| -rw-r--r-- | sbin/init/init.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sbin/init/init.8 b/sbin/init/init.8 index 2e64e598bccb..cefbf499d98a 100644 --- a/sbin/init/init.8 +++ b/sbin/init/init.8 @@ -286,6 +286,7 @@ as follows: .It Sy "Run-level Signal Action" .It Cm 0 Ta Dv SIGUSR1 Ta "Halt" .It Cm 0 Ta Dv SIGUSR2 Ta "Halt and turn the power off" +.It Cm 0 Ta Dv SIGWINCH Ta "Halt and turn the power off and then back on" .It Cm 1 Ta Dv SIGTERM Ta "Go to single-user mode" .It Cm 6 Ta Dv SIGINT Ta "Reboot the machine" .It Cm c Ta Dv SIGTSTP Ta "Block further logins" diff --git a/sbin/init/init.c b/sbin/init/init.c index 5fac6e2e180a..e6fcdb93ef3e 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -305,12 +305,12 @@ invalid: handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, SIGXFSZ, 0); handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, - SIGUSR1, SIGUSR2, 0); + SIGUSR1, SIGUSR2, SIGWINCH, 0); handle(alrm_handler, SIGALRM, 0); sigfillset(&mask); delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, - SIGALRM, SIGUSR1, SIGUSR2, 0); + SIGALRM, SIGUSR1, SIGUSR2, SIGWINCH, 0); sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; @@ -1557,8 +1557,9 @@ transition_handler(int sig) current_state == clean_ttys || current_state == catatonia) requested_transition = clean_ttys; break; + case SIGWINCH: case SIGUSR2: - howto = RB_POWEROFF; + howto = sig == SIGUSR2 ? RB_POWEROFF : RB_POWERCYCLE; case SIGUSR1: howto |= RB_HALT; case SIGINT: |
