Shutdown rcorder

Hi,

Since I currently have to run ZFS on top of md devices, I wonder about the order of shutting down services to prevent the service as well as ZFS from "crashing".

[cmd=]zpool create -f tank raidz1 /dev/md3 /dev/md4 /dev/md5 /dev/gpt/2TB-1 /dev/gpt/2TB-2[/cmd]

Additionally other services like samba, postfix, dovecot, [...] are using the ZFS Storage.

So generally I would need to ensure a shutdown order of something like this:

  1. service samba stop
  2. service postfix stop
  3. service dovecot stop
  4. service [...] stop
  5. zpool export tank
  6. service md-zfs stop (I wrote a script for this already)
  7. umount regular UFS drives

Even though if I would have to write my own script which would do the shutdown of services in my wished order when system shutdown is invoked I still wonder
  1. about an easier way to get to my goal - something like rcorder the other way around
  2. or how I would enforce that even my own script will get called first of all before the others?
Thanks for hints.
 
Have a read through rc(8) and rcorder(8).

Basically, look at the output of # rcorder /etc/rc.d /usr/local/etc/rc.d to see the order things are started (top-to-bottom). Then read that in reverse to see how things are shutdown.

All you have to do is edit the script that starts md and set it to BEFORE: zfs, or edit the script that starts zfs and set it to REQUIRES: md.

Everything else will happen automagically for you.
 
phoenix said:
Have a read through rc(8) and rcorder(8).

Basically, look at the output of # rcorder /etc/rc.d /usr/local/etc/rc.d to see the order things are started (top-to-bottom). Then read that in reverse to see how things are shutdown.

All you have to do is edit the script that starts md and set it to BEFORE: zfs, or edit the script that starts zfs and set it to REQUIRES: md.

Everything else will happen automagically for you.


Thanks! I was hoping for this ;)
 
Back
Top