From owner-freebsd-questions@FreeBSD.ORG Tue Feb 19 03:22:26 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C300A10 for ; Tue, 19 Feb 2013 03:22:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 1992F8DF for ; Tue, 19 Feb 2013 03:22:25 +0000 (UTC) Received: from r56.edvax.de (port-92-195-74-250.dynamic.qsc.de [92.195.74.250]) by mx02.qsc.de (Postfix) with ESMTP id 4827127729; Tue, 19 Feb 2013 04:22:23 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r1J3MRSd003103; Tue, 19 Feb 2013 04:22:27 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 19 Feb 2013 04:22:27 +0100 From: Polytropon To: Fbsd8 Subject: Re: How to add zfs support to FreeBSD? Message-Id: <20130219042227.7bcc3477.freebsd@edvax.de> In-Reply-To: <5122D83F.6090107@a1poweruser.com> References: <51229B47.4070605@a1poweruser.com> <5122A3BA.2000907@a1poweruser.com> <20130219015600.68050fb2.freebsd@edvax.de> <5122D83F.6090107@a1poweruser.com> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2013 03:22:26 -0000 On Mon, 18 Feb 2013 20:41:19 -0500, Fbsd8 wrote: > So the next question is there any sh script code I can use to > check if zfs has been enabled by the rc.conf zfs_enable statement. > > I need to determine if zfs is enabled on the host. Even though the statement zfs_enable="YES" may be part of /etc/rc.conf, it's still possible that the ZFS subsystem is _currently_ not running. So in my opinion you should check with something that relies on ZFS actually running. So there could be a difference between "is enabled" and "is running". Regarding "is enabled", you can easily check if the corresponding line in /etc/rc.conf is present. This could result in a false-positive answer regarding "is running". For example, if I add zfs_enable="YES" to /etc/rc.conf and check its presence (e. g. using grep), but I don't do anything else; I'll get this: % zfs internal error: failed to initialize ZFS library Here's an example from a system not running ZFS: /sbin/zfs > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "ZFS is currently running." else echo "ZFS is currently _not_ running." fi Check on a system running ZFS. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...