Re: Forcefully unmounting devfs...
From: Jilles Tjoelker (jilles_at_stack.nl)
Date: 12/22/04
- Previous message: Peter Edwards: "Re: Header files with enums instead of defines?"
- In reply to: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Next in thread: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Reply: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 22 Dec 2004 14:57:34 +0100 To: Kris Kennaway <kris@obsecurity.org>
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.
-- Jilles Tjoelker _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Peter Edwards: "Re: Header files with enums instead of defines?"
- In reply to: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Next in thread: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Reply: Kris Kennaway: "Re: Forcefully unmounting devfs..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|