Skip to contentSkip to conversation

Let init know user wants to shutdown

DISCUSSION [email protected] 1 participant 1 message Apr 11, 2001

lore
Share & tools
lore
#0 lore raw

Kurt Roeckx <[email protected]> on 04/11/2001 06:16:52 AM

To: Miquel van Smoorenburg <[email protected]>
cc: [email protected] (bcc: Amol Lad/HSS)

Subject: Re: Let init know user wants to shutdown

Quoted 11 lines · Kurt Roeckx
Quoted 6 lines · Miquel van Smoorenburg

the shutdown scripts
include "kill -15 -1; sleep 2; kill -9 -1". The "-1" means "all processes except me". That means init will get hit with SIGTERM occasionally during shutdown, and that might cause weird things to happen.

-1 mean everything but init.

Quoted 1 line
Quoted 1 line

well. don't fight.. here is something from kernel/signal.c

asmlinkage int sys_kill(int pid, int sig){
...
...
return kill_something_info(sig,&info,pid)
}

int
kill_something_info(int sig, struct siginfo *info, int pid){
...
...
...

     if (pid == -1){
          for_each_task(p){(int
               if (p->pid >1 && p != current){
                    err = send_sig_info(sig,info,p);
                    ...
                    ...
               }
          }
     }

Amol

Oh, maybe you mean killall5 -TERM?

Which would send a SIGTERM to all processes but the one in his own session.

(Hey look, you wrote that manpage.)

Kurt

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/