From owner-freebsd-stable@FreeBSD.ORG Mon Feb 27 19:49:44 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD551065676 for ; Mon, 27 Feb 2012 19:49:44 +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 55A7D8FC1B for ; Mon, 27 Feb 2012 19:49:44 +0000 (UTC) Date: Mon, 27 Feb 2012 20:49:42 +0100 From: vermaden To: Kevin Oberman , smithi@nimnet.asn.au X-Mailer: interia.pl/pf09 In-Reply-To: References: <4F3EE186.4020801@gmail.com> <201202181409.08859.hselasky@c2i.net> <20120226203949.H89643@sola.nimnet.asn.au> 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=1330372182; bh=PQmv4aaopkZO9/8F9Wr/vcOj2K+QVulhFO7DpLhWg5A=; 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=g3l36NMHaMlNqza1QEYNHbBwOugtFlvlldDzOZ8UALNFU77pP209Sv7zTgUTgFBeD Pf/ykRzk+wfn0Gf32xm99Xdj8XozajG2noSD2ZlrKNQi4Pij9uDCd/kMna8uIwxaem kSXvqeH1NublfqSq5MFa3ks6gOR9TnT40xXrracw= Cc: Hans Petter Selasky , freebsd-stable@freebsd.org, Ian Smith , lars.engels@0x20.net Subject: Re: devd based AUTOMOUNTER X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 19:49:45 -0000 Hi, I have been pretty busy lately because of boring things work/life stuff, but here is the new version, with more options of course and some bugs fixed, it now displays help when triggered as 'automount --help', at least a substitute of a man page ;) I have a quastion, which devd(8) events should I 'catch' to enable CD automount? Is there an event for a CD being entered into the CD-ROM at devd(8)? Second question, how to commit a port? I have a working port if I put all needed files when they need to be, but its PITA to install it that way ... Of course latest version is available here: https://github.com/vermaden/automount/ An example usage display: % automount --help =20 AUTOMOUNT is a devd(8) based automounter for FreeBSD. It supports following file systems: UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4 It needs these ports to mount NTFS/exFAT/EXT4 respectively: o sysutils/fusefs-ntfs o sysutils/fusefs-exfat o sysutils/fusefs-ext4fuse By default it mounts/unmounts all removable media but it is possible to set some additional options at the /usr/local/etc/automount.conf config file. Below is a list of possible options with description. MNTPREFIX (set to /media by default) With this options You can alter the default root for mounting the removable media, for example to the /mnt directory. example: MNTPREFIX=3D"/media" ENCODING (set to en_US.ISO8859-1 by default) Only used with FAT32 mounts, specifies which encoding to use at the mount. example: ENCODING=3D"pl_PL.ISO8859-2" CODEPAGE (set to cp437 by default) Only used with FAT32 mounts, specifies which code page to use at the mount. example: CODEPAGE=3D"cp852" USER (unset by default) If set to some username, the mount command will chown(1) the mount directory with the user and its primary user group. If used with FM option allows to launch the specified file manager after a successful mount. example: USER=3D"vermaden" FM (unset by default) If set to file manager command, the mount will launch the specified command after successful mount. Works only if USER parameter is also set. example: FM=3D"nautilus --browser --no-desktop" USERUMOUNT (set to NO by default) When set to YES it will 'chmod +s /sbin/umount' which would allow an USER to unmount the file system with their selected file manager. example: USERUMOUNT=3D"YES" ATIME (set to YES by default) When set to NO it will mount filesystems with noatime options when possible. example: ATIME=3D"NO" REMOVEDIRS (set to NO by default) When set to YES it will remove empty directories under the used after device detach. example: REMOVEDIRS=3D"YES" Now for the questions ... >> Added 'noatime' as a default mount option when possible. > Good idea for many use cases, but could that be optional? Its optional now, then ATIME option. >> The USERMOUNT otions if set to YES (default to NO) >> will 'chmod +s /sbin/umount', so You can click the ^ >> button on the devices list in NAUTILUS. > Someone might explain why I needn't feel a bit > uncomfortable about that chmod, even though it is > optional, and even though I've been guilty myself of > a 'chown root:nobody /sbin/tc' on a linux firewall box Well, its optional, You do not have to use it ;) >> These newly mounted devices appear on NAUTILUS >> sidebar (only with /media prefix). > I wonder how it goes with KDE4? (still 3.5 here) Freddie Cash reported that they also appear at Konqueror and Dolphin, both KDE 3.x and 4.x. > Er, who's user 1000 ? Another config item perhaps? > Or should that be the particular user currently > invoking the script via devd (if that can be determined?)? It was 'development' branch ;) I tried many things then, its now a configurable option as USER. > Also, are you using sysctl vfs.usermount=3D1? No, its not needed, the mount is done by root and umount even by user with USERUMOUNT=3DYES does not require the vfs.usermount=3D1 option. > Mmm, fsck on every attachment? Maybe running > fsck should be optional? We might be attaching, > perhaps, a 2TB backup HD? .. > Ouch! I agree. Why not just fsck_ufs -p. (I realize > this is done to fix systems that were unplugged > rather than umounted, but it's a pretty expensive > operation when not needed. I have added -C option to fsck for UFS, so it will onlt check filesystem if clean flag is not set. >> mount -o noatime ${I} ${MNT} > Again, I'd rather see that optional in an intended > system tool, although it's an option I'd tend to use myself. Its optional now with ATIME option. >> find ${MNTPREFIX} -type d -empty -delete > I don't see the need to remove all empty subdirs > of, say, /media - this tool may not be the only > thing wanting to manage that space? Removing=20 > directories that were added by this tool itself > makes sense of course. It only removed EMPTY directories, which was mostly harmless, but I made it to not delete them by default and added an option to enable that as well. > Looks like a neat gadget, don't mind me picking > up on a few aspects :) Thanks mate, try latest version ;) >> I don't see the need to remove all empty subdirs >> of, say, /media - this tool may not be the only >> thing wanting to manage that space? =C2=A0Removing >> directories that were added by this tool itself >> makes sense of course. =20 > This is an interesting one. Gnome and hald have > a problem here that have caused me to add sudo > /bin/rmdir /media/* to.xinitrc to work around. > It's just too easy for 'junk' directories to live on > when the system does not exit everything cleanly > and, while hald tries to keep track, it is very hard > to do in the real world. I suspect it is really > needed. And what else is creating directories in > /media? I made it configurable via option if someone has a habbit to put other things over there ;) Thanks for interesting input mates, king regards, vermaden ...