From owner-freebsd-questions@FreeBSD.ORG Thu May 26 11:28:20 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64946106566B; Thu, 26 May 2011 11:28:20 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C2E178FC0C; Thu, 26 May 2011 11:28:19 +0000 (UTC) Received: by fxm11 with SMTP id 11so836155fxm.13 for ; Thu, 26 May 2011 04:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:user-agent :mime-version:content-type; bh=in9rwpfXHr7XI0dmoWFY/68/6aEfnGX8zkDyONY7fzg=; b=rhnzt/Zdl75qIx4RgqAVtAJO0lgfP+C7JHGC6m30eu1PmnnAt0VIPzSUx0NbX5Qv4M CT8x5ygY/xhKx/YRMNgRKg6LE7uiUB4rlPtI2tDFm9rXmeeh4slsegz5Gx6nIdZd3UUl Y6VJQMdgvII384kgB5SiwJLyw9dlboP4hLbyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-type; b=GMLEG5sD/r+ThLOuZU/q25IAfiWk+2fVYuy3/iYIm5nIVg7J8shkHcBUa/dg6t+C50 drKRIolWScKsOWvDCowURvEFTiQtrR7eNOuUi2teEEVLvq1CSU093+p+mzG4HDTz54UD 0NEcI5ceGau1AH+iNc9QUhpR19c6otZj03ROE= Received: by 10.223.91.85 with SMTP id l21mr807405fam.80.1306409298675; Thu, 26 May 2011 04:28:18 -0700 (PDT) Received: from localhost (tor-exit-router36-readme.formlessnetworking.net [199.48.147.36]) by mx.google.com with ESMTPS id q10sm258929fan.8.2011.05.26.04.28.15 (version=SSLv3 cipher=OTHER); Thu, 26 May 2011 04:28:17 -0700 (PDT) From: Pan Tsu To: freebsd-questions@freebsd.org Date: Thu, 26 May 2011 15:28:02 +0400 Message-ID: <868vttd7lp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: Stanislav Sedov Subject: fuser(1): do FIFOs and sockets count as "named" files? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 11:28:20 -0000 fuser(1) man page mentions the tool is supposed to list processes that have specified named file(s) open. As there are several types of files (according to stat(2)) it's not clear which are supported, e.g. $ (mkfifo foo.fifo; cat <>foo.fifo) & nc -lU foo.socket & $ fuser foo.* foo.fifo: foo.socket: $ procstat -af | awk 'NR == 1 || /foo/' PID COMM FD T V FLAGS REF OFFSET PRO NAME 6672 cat 0 f - rw------ 2 0 - /home/luser/foo.fifo 11493 nc 3 s - rw------ 2 0 UDS foo.socket $ fstat | awk 'NR == 1 || $2 ~ /cat/ && $4 ~ 0 || $2 ~ /nc/ && $4 ~ 3' USER CMD PID FD MOUNT INUM MODE SZ|DV R/W luser nc 11493 3* local stream fffffe00a980d690 luser cat 6672 0 /home/luser 5982 prw-r--r-- 0 rw fuser(1) on BusyBox/Linux does show open FIFOs, not sure about sockets. -- FreeBSD 9.0-CURRENT r222247M amd64