Re: Problem running custom startup script at proper time
On Mon, Sep 20, 2010 at 09:00, Robert Bonomi wrote: >> From owner-freebsd-questi...@freebsd.org Sun Sep 19 16:37:49 2010 >> From: Aaron >> Date: Sun, 19 Sep 2010 14:39:08 -0700 >> To: freebsd-questions@freebsd.org >> Subject: Re: Problem running custom startup script at proper time >> >> Doh! Forgot to reply to the mailing list. >> >> >> Nope, that didn't work either. Darn. Maybe I'll just have to modify >> the /etc/rc.d/zfs script to run the for loop first :( > > How about just modifying the REQUIRE header on it to include 'gnop' > the sequencer that selects the order to run rc.d things in sorts based > on the REQUIRE/PROVIDES dependencies. > Nope, that didn't fix it. I even tried editing /etc/rc.d/zfs and included the gnop commands in the zfs_start(). The gnop still started up _after_ the ZFS in dmesg. However, I did figure it out after looking at the services that were starting up. There is apparent a 'zvol' script, which was the culprit. It was loading some ZFS stuff before the 'zfs' script. Once I set the 'gnop' script to startup before the 'zvol' script, worked like a charm. My zpool status now shows that it's using the gnop devices. Yay!! >> >> On Sun, Sep 19, 2010 at 14:04, Boris Samorodov wrote: >> > On Sun, 19 Sep 2010 13:55:41 -0700 Aaron wrote: >> >> On Sun, Sep 19, 2010 at 13:27, Boris Samorodov wrote: >> >> > On Sun, 19 Sep 2010 12:40:52 -0700 Aaron wrote: >> >> > >> >> >> # PROVIDE: gnop >> >> > >> >> > What if you try "PROVIDE: disks" instead? >> > >> >> No good. I also tried the following in the gnop script: >> > >> >> # PROVIDE: gnop >> >> # REQUIRE: mountcritlocal >> >> # BEFORE: zfs >> > >> > /etc/rc.d/geli has this: >> > - >> > # PROVIDE: disks >> > # REQUIRE: initrandom >> > # KEYWORD: nojail >> > - >> > >> > Seems that that should work for you. If not I'm out of ideas >> > for now. >> > >> >> The services -r looks promising, but the dmesg is still the same :( >> >> =A0When I disable zfs auto-mount, and then run it manually after boot, >> >> it uses the .nop devices that were created correctly as it should. >> > >> >> EXCERPT services -r >> >> /etc/rc.d/mdconfig >> >> /etc/rc.d/mountcritlocal >> >> /etc/rc.d/gnop >> >> /etc/rc.d/zfs >> > >> > -- >> > WBR, Boris Samorodov (bsam) >> > Research Engineer, http://www.ipt.ru Telephone & Internet SP >> > FreeBSD Committer, http://www.FreeBSD.org The Power To Serve >> > >> ___ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" >> > > / > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Problem running custom startup script at proper time
> From owner-freebsd-questi...@freebsd.org Sun Sep 19 16:37:49 2010 > From: Aaron > Date: Sun, 19 Sep 2010 14:39:08 -0700 > To: freebsd-questions@freebsd.org > Subject: Re: Problem running custom startup script at proper time > > Doh! Forgot to reply to the mailing list. > > > Nope, that didn't work either. Darn. Maybe I'll just have to modify > the /etc/rc.d/zfs script to run the for loop first :( How about just modifying the REQUIRE header on it to include 'gnop' the sequencer that selects the order to run rc.d things in sorts based on the REQUIRE/PROVIDES dependencies. > > On Sun, Sep 19, 2010 at 14:04, Boris Samorodov wrote: > > On Sun, 19 Sep 2010 13:55:41 -0700 Aaron wrote: > >> On Sun, Sep 19, 2010 at 13:27, Boris Samorodov wrote: > >> > On Sun, 19 Sep 2010 12:40:52 -0700 Aaron wrote: > >> > > >> >> # PROVIDE: gnop > >> > > >> > What if you try "PROVIDE: disks" instead? > > > >> No good. I also tried the following in the gnop script: > > > >> # PROVIDE: gnop > >> # REQUIRE: mountcritlocal > >> # BEFORE: zfs > > > > /etc/rc.d/geli has this: > > - > > # PROVIDE: disks > > # REQUIRE: initrandom > > # KEYWORD: nojail > > - > > > > Seems that that should work for you. If not I'm out of ideas > > for now. > > > >> The services -r looks promising, but the dmesg is still the same :( > >> =A0When I disable zfs auto-mount, and then run it manually after boot, > >> it uses the .nop devices that were created correctly as it should. > > > >> EXCERPT services -r > >> /etc/rc.d/mdconfig > >> /etc/rc.d/mountcritlocal > >> /etc/rc.d/gnop > >> /etc/rc.d/zfs > > > > -- > > WBR, Boris Samorodov (bsam) > > Research Engineer, http://www.ipt.ru Telephone & Internet SP > > FreeBSD Committer, http://www.FreeBSD.org The Power To Serve > > > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" > / ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Problem running custom startup script at proper time
--On Sunday, September 19, 2010 2:39 PM -0700 Aaron wrote: Doh! Forgot to reply to the mailing list. Nope, that didn't work either. Darn. Maybe I'll just have to modify the /etc/rc.d/zfs script to run the for loop first :( Do you load zfs.ko in loader.conf? I have built a few NAS systems on NanoBSD and found that I had to wait loading zfs until I had go the cache file copied from backup storage as I am using the diskless setup. Could it be that you need to run your script before loading zfs.ko? Cheers, Göran On Sun, Sep 19, 2010 at 14:04, Boris Samorodov wrote: On Sun, 19 Sep 2010 13:55:41 -0700 Aaron wrote: On Sun, Sep 19, 2010 at 13:27, Boris Samorodov wrote: > On Sun, 19 Sep 2010 12:40:52 -0700 Aaron wrote: > >> # PROVIDE: gnop > > What if you try "PROVIDE: disks" instead? No good. I also tried the following in the gnop script: # PROVIDE: gnop # REQUIRE: mountcritlocal # BEFORE: zfs /etc/rc.d/geli has this: - # PROVIDE: disks # REQUIRE: initrandom # KEYWORD: nojail - Seems that that should work for you. If not I'm out of ideas for now. The services -r looks promising, but the dmesg is still the same :( When I disable zfs auto-mount, and then run it manually after boot, it uses the .nop devices that were created correctly as it should. EXCERPT services -r /etc/rc.d/mdconfig /etc/rc.d/mountcritlocal /etc/rc.d/gnop /etc/rc.d/zfs -- WBR, Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD Committer, http://www.FreeBSD.org The Power To Serve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Problem running custom startup script at proper time
Doh! Forgot to reply to the mailing list. Nope, that didn't work either. Darn. Maybe I'll just have to modify the /etc/rc.d/zfs script to run the for loop first :( On Sun, Sep 19, 2010 at 14:04, Boris Samorodov wrote: > On Sun, 19 Sep 2010 13:55:41 -0700 Aaron wrote: >> On Sun, Sep 19, 2010 at 13:27, Boris Samorodov wrote: >> > On Sun, 19 Sep 2010 12:40:52 -0700 Aaron wrote: >> > >> >> # PROVIDE: gnop >> > >> > What if you try "PROVIDE: disks" instead? > >> No good. I also tried the following in the gnop script: > >> # PROVIDE: gnop >> # REQUIRE: mountcritlocal >> # BEFORE: zfs > > /etc/rc.d/geli has this: > - > # PROVIDE: disks > # REQUIRE: initrandom > # KEYWORD: nojail > - > > Seems that that should work for you. If not I'm out of ideas > for now. > >> The services -r looks promising, but the dmesg is still the same :( >> When I disable zfs auto-mount, and then run it manually after boot, >> it uses the .nop devices that were created correctly as it should. > >> EXCERPT services -r >> /etc/rc.d/mdconfig >> /etc/rc.d/mountcritlocal >> /etc/rc.d/gnop >> /etc/rc.d/zfs > > -- > WBR, Boris Samorodov (bsam) > Research Engineer, http://www.ipt.ru Telephone & Internet SP > FreeBSD Committer, http://www.FreeBSD.org The Power To Serve > ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: Problem running custom startup script at proper time
On Sun, 19 Sep 2010 12:40:52 -0700 Aaron wrote: > # PROVIDE: gnop What if you try "PROVIDE: disks" instead? -- WBR, Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD Committer, http://www.FreeBSD.org The Power To Serve ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Problem running custom startup script at proper time
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" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"