This particular instance type mounts two ephemeral drives, in
/mnt/. I have to create working directories for one of my services in these paths at startup or the services won't launch. Sometimes the script below works, sometimes it does not. I suspect it's a race between the folder being mounted, and my rc.local script kicking off.
Is there a more reliable place I can create these directories? The last time I booted up, the
/mnt/mongodb dir did get created, but the
/dev/ one did not. I'm running the 12.04 HVM ubuntu instance from amazon.
Here is my rc.local file:
cd /mnt/ sudo mkdir mongodb sudo chown -R mongodb mongodb sudo chgrp -R mongodb mongodb cd /dev/ sudo mkdir mongodb sudo chown -R mongodb mongodb sudo chgrp -R mongodb mongodb sudo service mongodb start exit 0