From owner-freebsd-current@FreeBSD.ORG Sun Feb 19 21:47:17 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF00C1065673; Sun, 19 Feb 2012 21:47:16 +0000 (UTC) (envelope-from vermaden@interia.pl) Received: from smtpo.poczta.interia.pl (smtpo.poczta.interia.pl [217.74.65.207]) by mx1.freebsd.org (Postfix) with ESMTP id 5ACC68FC0C; Sun, 19 Feb 2012 21:47:16 +0000 (UTC) Date: Sun, 19 Feb 2012 22:47:13 +0100 From: vermaden To: Hans Petter Selasky X-Mailer: interia.pl/pf09 In-Reply-To: <201202181409.08859.hselasky@c2i.net> References: <4F3EE186.4020801@gmail.com> <201202181409.08859.hselasky@c2i.net> X-Originating-IP: 85.89.187.172 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1329688033; bh=9/MNWYs7Ft6MAEHGeE9EwQnSnOeFjfXZh4BfC/b/IK8=; h=Date:From:Subject:To:Cc:X-Mailer:In-Reply-To:References: X-Originating-IP:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=I0ywxDhUIu/61lMN/0q9rgCmTaecSOhwOq2jcjXDYLF53uRlkNVnn5LfKKDCP4UU0 bCz19PNQYijxEeKxwhvOLPVvuff2eUtlidndqCqVS6uscFxPOKsCdUxs8gBQQ+9Ig8 QizOzo4n76GD3bMSh5zdaZ8JA+VIfMqhYu4W1DVE= X-Mailman-Approved-At: Sun, 19 Feb 2012 21:51:27 +0000 Cc: matt , gleb.kurtsou@gmail.com, freebsd-stable@freebsd.org, uffe@uffe.org, freebsd-hackers@freebsd.org, joe.culler@gmail.com, freebsd-current@freebsd.org, lars.engels@0x20.net Subject: Re: devd based AUTOMOUNTER X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2012 21:47:17 -0000 Hi, sorry for late response, but I currently have quite a lot 'weekend activities' that are definitely not near a computer ;) written by Gleb Kurtsou ...=20 >> __state_lock() { >> while [ -f ${STATE}.lock ]; do sleep 0.5; done >> :> ${STATE}.lock >> } > > Why not keep it stateless, unmounting by hand would kill integrity. The state file is needed for automatic umount of fuse-based mounts, the device that script would be triggered will be /dev/da0 for example while the 'virtual' device that was actually used for the mount was /dev/fuse0, that is why I need to track what is mounted and how. These functions are mostly to keep that 'state file' integral, to prevent two various event writing at the file simultanously, which would probable killed the information integrity. Unmounting the device does not kill integrity at all, I also thought about that, You may plug the device, do whatever You want, event change the filesystem there and mount it again, but when You umount it and unplug it, then the script will umount that device (yes pointless here at this moment) and remove the entry from state file. > Usage of `file` is a big security concern. Can You explain why? > I think geom config and list of mounted file systems should be > sufficient for collecting information at runtime. Although it may not be > that easy for disks without partitioning. geom config? I also make use of the list of mounted filesystems, but the problem with fuse-based devices remain as I stated earlier. > I'm using a python script for mounting/unmounting removable disks, > but having similar tool written in sh would be great. >=20 > https://github.com/glk/mmount Thanks for sharing, maybe I will find some ideas there ;) written by Uffe Jakobsen ... > Nice, Thanks. > Instead of requiring modification to /etc/devd.conf why not just > put a "plugin" conf-file in /etc/devd/ - well even better put in > /usr/local/etc/devd/ - that way your devd.conf modifications are > not lost upon patching/updating base os. Great advice, I will do that in the next 'release' ;) > There is an existing port called "automounter" by Dominic Fandrey > which is much similar to your work. Yes but its amd based. > His "automounter" also works with disk labels > (as found in /dev/ufs/ and /dev/msdosfs/ etc) The labels are only 'an addition' to appearing device nodes at /dev, Yes it would be nice to see that /dev/msdosfs/BACKUP is mounted instead of /dev/da0s1, but I will have to make a lot of additional check to see if that new label is part of that or other device etc. > You should consider make a port out of your work. I probably will try to do that, but I think it stil needs polish ;) written by Lars Engels ... > And please don't hardcode polish locales in mount_msdosfs :-) I already changed that, I also plan to create simple config file, it was just not 'the most important thing' that I was dealing with at that time, its easy to move options into variables, its harder to make script work the way it should ;) But thanks for suggestion, good point. written by Joe Culler ... > Thanks for working on it. It works great for me, thanks! Thanks, good to know ;) > I have a question, could you export a fusefs-exfat or > fusefs-ntfs share directory over NFS? I can't get it work. > If you have a solution, please let me know, thanks. I will try to do that tomorrow ane let You know. Regards, vermaden ---