Re: Let init know user wants to shutdown

From: alad@hss.hns.com
Date: Tue Apr 10 2001 - 23:31:49 EST


Kurt Roeckx <Q@ping.be> on 04/11/2001 06:16:52 AM

To: Miquel van Smoorenburg <miquels@cistron-office.nl>
cc: linux-kernel@vger.kernel.org (bcc: Amol Lad/HSS)

Subject: Re: Let init know user wants to shutdown

On Wed, Apr 11, 2001 at 01:38:30AM +0200, Kurt Roeckx wrote:
> On Tue, Apr 10, 2001 at 11:20:24PM +0000, Miquel van Smoorenburg wrote:
> >
> > 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.

>>> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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



This archive was generated by hypermail 2b29 : Sun Apr 15 2001 - 21:00:15 EST