2

I am running the latest Apple OS X 10.10(.1) Yosemite, and the latest Adobe Coldfusion 11. Everything works ok, but the server does not startup automatically on startup. I can go into Terminal and use:

cd /Applications/ColdFusion11/cfusion/bin
sudo ./coldfusion start

However the server is not on by default. How do I set it so that it launches every time the computer starts up?

Henry Gibson
  • 2,038
  • 2
  • 15
  • 12

3 Answers3

8

This is the same issue as MySQL suffers. If you go to:

/Library/StartupItems

You will see that both ColdFusion and MySQL (if you have it installed) have created startup items - however that functionality has been deprecated by Apple (see Mac Developer Library: Startup Items) so the services do not startup automatically as desired. The preferred method is by using Launch Daemons.

To do so you must create an XML / text file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key> 
    <string>com.coldfusion.startup</string>
    <key>Disabled</key> 
    <false/>
    <key>OnDemand</key> 
    <true/>
    <key>RunAtLoad</key> 
    <true/>
    <key>UserName</key> 
    <string>root</string>
    <key>AbandonProcessGroup</key> 
    <true/>
    <key>ProgramArguments</key>
    <array>
        <string>/Applications/ColdFusion11/cfusion/bin/coldfusion</string>
        <string>start</string>
    </array>
    <key>ProcessType</key> 
    <string>Background</string>
</dict>
</plist>

Replace 'root' with a valid admin UserName. This file should then be saved to the following directory, I used the filename 'com.coldfusion.startup.plist':

/Library/LaunchDaemons

The system may ask for your password to save the file here if you're using Finder to do so.

Now using Terminal, you must set the appropriate access permissions on the new file you have created, so that it will run properly on startup. Use the following 3 commands:

sudo chown root /Library/LaunchDaemons/com.coldfusion.startup.plist 
sudo chgrp wheel /Library/LaunchDaemons/com.coldfusion.startup.plist 
sudo chmod 644 /Library/LaunchDaemons/com.coldfusion.startup.plist

Finally you should run the new LaunchDaemon once to register it and ensure it runs on startup subsequently:

sudo launchctl load /Library/LaunchDaemons/com.coldfusion.startup.plist

Now if you restart your system ColdFusion should run automatically. Excellent. I pieced this together from a couple of articles listed below:

Autostart MySQL Server on Mac OS X Yosemite

Autostart ColdFusion in OS X Yosemite

The CF Launch Daemon is only marginally altered to work with CF11 etc. If you use a simpler Launch Daemon it doesn't work. You also need the permissions from the MySQL question - so many thanks to the respective authors.

Community
  • 1
  • 1
Henry Gibson
  • 2,038
  • 2
  • 15
  • 12
1

I do not have the Privileges yet to comment on the Accepted Answer from Henry Gibson, but I wanted to add some things I found very helpful:

  1. I installed ColdFusion under the root user, so that was the only account that would work for UserName
  2. The only way I found this out was to add the following key pairs to the plist file:

    <key>StandardOutPath</key>
    <string>/var/log/coldfusion.startup.daemon.log</string>
    <key>StandardErrorPath</key>
    <string>/var/log/coldfusion.startup.daemon.log</string>
    <key>Debug</key>
    <true/>
    

I found these keys here on the Apple Mac Dev Library Daemons and Services Programming Guide.

Hope this helps bia.migueis!

Community
  • 1
  • 1
TASr
  • 63
  • 3
-2

Try this: start the ColdFusion 11 service using this command and then reboot your Mac.

sudo ./coldfusion start
Pavan Manjunath
  • 27,404
  • 12
  • 99
  • 125
Priyank
  • 34
  • 1
  • Sorry yes, my top question should have said 'sudo' - had already tried that, but it makes no difference - will edit the question. The coldfusion start command works just fine - the server runs ok - the issue is that it isn't doing it automatically when the machine first starts up - is more of an annoyance than anything. – Henry Gibson Jan 05 '15 at 23:13