Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Delay services until external drive mounts?

I have a Drobo 5D connected to my Mac running OS X Server. I use my Drobo to host the "Service Data" folder. For the most part, this has been a great setup, however - in the event of a cold-start, I need my OS X Server to delay starting services (mainly mail server) until the Drobo is mounted.


In a cold start scenario, my Mac boots and is ready to go before my Drobo has completed its power on initialization (particularly in the event of a power outage). When this happens, the Drobo is not mounted when OS X Server starts the mailserver. Since the folder "/Volumes/Drobo" can not be found, OS X creates it with owner "_dovecot" (the mail service uid). When my Drobo becomes ready, it mounts under "/Volumes/Drobo 1" ... this results in the mail service storing my mail in an invalid location, and the remainder of my services (time machine server) not being available.


Is there a way to delay the start of the mail service until the drive is mounted? Or even just to introduce a time-delay? If I put a 5 minute delay, it would be more than sufficient.


Thanks!


(Note: this is OS X 10.9.1 Server... I accidentally tagged it Mac OS 9, and my update doesn't seem to take affect)

Mac mini, Mac OS 9.0.x, OS X Server

Posted on Jan 12, 2014 5:26 PM

Reply
2 replies

Jan 12, 2014 6:55 PM in response to zbltim

Caveat: I have not tried altering the startup delay setting via the systemsetup command-line command, but it looks to be close to what you want. Here are the applicable parts of the systemsetup man page:


systemsetup

-getwaitforstartupafterpowerfailure

Get the number of seconds after which the computer will start up after a power failure.

-setwaitforstartupafterpowerfailure seconds

Set the number of seconds after which the computer will start up after a power failure. The <seconds> value must be a multiple of 30 seconds.


Here's an example of fetching the current delay value from an OS X Mavericks box;


$ sudo systemsetup -getwaitforstartupafterpowerfailure

Password:

getwaitforstartupafterpowerfailure: 0 seconds

$


Based on your requirements and the description, maybe 300 seconds waiting for the disk to come online and to finish whatever RAID rebuild or controller initialization is necessary here would be the obvious test.


See if it works. (Please let us know, too.)


Possible hardware options include sequencing power strips (power bars), but those aren't cheap; US$300 seems to be typical for one of those, and the ones I've located (Middle Atlantic) don't have delays anywhere near as long as your environment seems to require.


Sequencing this startup from another system via a network-connected power strip — those tend to be a little over US$100, last I checked — would also be feasible; if you have another box (Mac, Linux, PC, Plug Computer, whatever) that can power up and manage the network power strip for you.

Feb 5, 2014 7:40 PM in response to zbltim

It's not a delay in startup that the OP is looking for, it's a delay of services while their external RAID array mounts.


I've solved this issue in a slightly different way- modify /etc/fstab to specify your hard drive to the specific path. This seems to force the drive to where it should be, or it is mounted before the service begins. Either way, it solves the issue.



In terminal...


  1. Go to the /Volumes/ folder and delete the folder that has your volume name. (cd /Volumes; rm -rf <diskname> will work, but be sure you know what you're doing)
  2. mv <diskname>_1 <diskname>
  3. Get the UUID of your volume by typing 'diskutil info <diskname>'
  4. In your favorite command line text editor, add the line into /etc/fstab, replacing <uuid> and <diskname> with the proper values. Spaces are '\040'

UUID=<uuid> /Volumes/<diskname> hfs rw


Reboot and your problems shouldn't occur again.

Delay services until external drive mounts?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.