OK, this solution works for me. First, create this script in /usr/local/bin and call it restartvpn.sh:
#!/bin/sh
#
# The "live" version of this script lives in /usr/local/bin
#
# In Yosemite and Server 4.0.x the racoon daemon fails to start correctly when there is a reboot
# It gives an error that it can't bind to an address
# The solution is to turn the VPN off and then back on, which clears this up
# That can be done manually but it's easy to forget when there is a reboot
# so this tries to automate that as a launchctl script
# If this runs immediately serveradmin returns an error and the script doesn't work so sleep some first
sleep 60
# Stop the VPN
/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin stop vpn
echo Sleep until things settle down
sleep 180
# Now start it back up
echo Restarting VPN
/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin start vpn
echo VPN restart complete
Then create this plist file /Library/LaunchDaemons/yourdomain.restart.plist. Note you should put a domain in the name, instead of yourdomain, in the plist file name and in the Label value in the plist but it isn't mandatory AFAIK
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>yourdomain.restartvpn</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/restartvpn.sh</string>
</array>
<key>StandardOutPath</key>
<string>/var/log/restartvpn.log</string>
<key>StandardErrorPath</key>
<string>/var/log/restartvpn.log</string>
<key>RunAtLoad</key>
<true/>
<key>ExitTimeOut</key>
<integer>300</integer>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
Now load it using
sudo launchctl load -w /Library/LaunchDaemons/yourdomain.restartvpn.plist
When you login after reboot this should get the VPN working. It logs to /var/log/restartvpn.log so you can watch the progress. Both sleeps seem necessary though I didn't experiment to see how short they could be.
I'm no expect at these launch daemons but this seems to work and I don't think there are any bad side effects. If there are, don't blame me 🙂