Re: Forcefully unmounting devfs...

From: Kris Kennaway (kris_at_obsecurity.org)
Date: 12/22/04

  • Next message: Julian Elischer: "Re: no more <sys/vnode.h> in device drivers."
    Date: Wed, 22 Dec 2004 11:42:46 -0800
    To: Jilles Tjoelker <jilles@stack.nl>
    
    
    

    On Wed, Dec 22, 2004 at 02:57:34PM +0100, Jilles Tjoelker wrote:
    > On Tue, Dec 21, 2004 at 03:23:54PM -0800, Kris Kennaway wrote:
    > > Unfortunately that's going to cause me a fair amount of pain, unless
    > > there's a simple way to kill all processes running in a given chroot
    >
    > Not that hard, although it is a bit tricky because command names may
    > contain spaces, so something obvious like this does not work in the
    > general case:
    >
    > fstat /chroot |awk '$4 == "root" { print $3 }'
    >
    > But the following seems more reliable, assuming the mount points do not
    > contain spaces:
    >
    > #!/bin/sh
    >
    > # USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME
    > # jilles zsh 57711 root / 2 drwxr-xr-x 1024 r /
    >
    > D="$1"
    > fstat "$D" | sed -Ene 's#^.* +([[:digit:]]+) +root +/[^ ]* +[[:digit:]]+ +.......... +[[:digit:]]+ +(r|rw|w) +'"$D"'$#\1#p'
    >
    > This would need some |xargs kill or similar.

    Thanks, I hadn't thought of using fstat. I'll give this a try!

    Kris

    
    



  • Next message: Julian Elischer: "Re: no more <sys/vnode.h> in device drivers."

    Relevant Pages

    • Re: Forcefully unmounting devfs...
      ... > Unfortunately that's going to cause me a fair amount of pain, ... > there's a simple way to kill all processes running in a given chroot ... This would need some |xargs kill or similar. ...
      (freebsd-arch)
    • Re: Please Try and Help Terri......
      ... with "no life in any meanigful sense". ... Neither is "kill me if I go mad". ... Killing because you think the person involved would ... She is in no pain. ...
      (comp.os.linux.misc)
    • Re: Please Try and Help Terri......
      ... with "no life in any meanigful sense". ... Neither is "kill me if I go mad". ... Killing because you think the person involved would ... She is in no pain. ...
      (alt.os.linux)
    • Re: Re: they are confering through the highway now, wont assess receivers later
      ... From the telescreen a brassy female voice ... thing was to kill yourself before they got you. ... astonishment of the biological uselessness of pain and fear, ... are fighting for are always forgotten, because the body swells up until it ...
      (sci.crypt)
    • Re: Easy-to-Use Palm Pistol Aimed at Elderly, Disabled
      ... probably every doctor with terminally ill patients in great pain ... has prescribed doses of painkillers that might well kill the patient ... No ethical doctor would allow a patient to suffer ... virtually the same as a lethal dose. ...
      (rec.guns)