From owner-freebsd-questions@FreeBSD.ORG Sun Sep 19 20:03:40 2010 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 402151065693 for ; Sun, 19 Sep 2010 20:03:40 +0000 (UTC) (envelope-from drizzt321@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id EB0DF8FC1C for ; Sun, 19 Sep 2010 20:03:39 +0000 (UTC) Received: by qwg5 with SMTP id 5so3418492qwg.13 for ; Sun, 19 Sep 2010 13:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=zuYtgDnyStHWiEeXh3qaYcucz36PcsYll1IXJU31940=; b=bv00HNc7D14r3Wdhx3c+VC47xNNlnL/Pcovk7v11u6X6zuEDIszZ6OQh2VnyPEIqxT mKYKtHd9waUzt+UefsuLG3HaUTWjK6kRY1WhriN3rExINbGWqxpVVlOHRDbyM7C7OC0n rc3Z8gztKpwc8UKuY8eUbPtW58JXdrpCc2nYU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=JpICXkn5m9KOgO7m0DTkYk+8DuQpnIbX/v7lmwGGWsTJonrcm5NdW+y+Z6mDc/HbsA duJmnVyNGTXHpfYHgxg6ZqD7s/tUgIb+18t6fBJ+t6NT6O2LrQspkKQ510hXNfvmolTR O+ybg+Z1lruLhRxk68vo1u6dO1ImU3Ede/FjA= Received: by 10.229.249.198 with SMTP id ml6mr5415887qcb.117.1284925272227; Sun, 19 Sep 2010 12:41:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.236.85 with HTTP; Sun, 19 Sep 2010 12:40:52 -0700 (PDT) From: Aaron Date: Sun, 19 Sep 2010 12:40:52 -0700 Message-ID: To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Problem running custom startup script at proper time 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: Sun, 19 Sep 2010 20:03:40 -0000 I'm having trouble getting a custom startup script to run at the proper time. I'm having to use gnop with my new Western Digital WD10EARS (1TB, 4K sector size) because it reports the standard 512 byte to the OS. I'm basing it on http://www.cod3r.com/2010/06/zfs-on-western-digital-ears-drives/ which also says that it needs to be run on each boot so that ZFS will use the .nop devices. So, I've created a custom startup script to automatically do this for me at the proper time (before zfs starts and auto-mounts). I'm having trouble getting it to work properly though. In services -r, it is listed before the zfs startup script, but in dmesg the gnop messages come after the zfs startup messages. Below is excerpts from services -r, dmesg, and the startup script in its entirety. EXCERPT FROM services -r /etc/rc.d/hostid_save /etc/rc.d/mdconfig /etc/rc.d/mountcritlocal /etc/rc.d/gnop /etc/rc.d/zfs /etc/rc.d/FILESYSTEMS /etc/rc.d/var /etc/rc.d/cleanvar EXCERPT FROM dmesg Trying to mount root from ufs:/dev/ad0s1a ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present; to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf. ZFS filesystem version 3 ZFS storage pool version 14 GEOM_NOP: Device ad6.nop created. GEOM_NOP: Device ad8.nop created. GEOM_NOP: Device ad10.nop created. GEOM_NOP: Device ad12.nop created. STARTUP SCRIPT, /etc/rc.d/gnop #!/bin/sh # # PROVIDE: gnop # REQUIRE: mdconfig . /etc/rc.subr name="gnop" start_cmd="gnop_start" gnop_start() { for i in ad6 ad8 ad10 ad12; do gnop create -S 4096 $i; done } load_rc_config $name run_rc_command "$1"