Quite a few months ago I did a blog post about starting ColdFusion on boot with Ubuntu Linux. When I originally wrote the post I did put a disclaimer on there that I was indeed new to Linux and there was probably a better way to do what I was attempting to do. I was right.
There is a very easy way to accomplish this in three steps and it does not require editing your system files or going through all the run levels and trying to figure out where to start and stop ColdFusion.
The first thing you need to do is make sure the chkconfig utility is installed on your system. I do not believe it is installed by default on Ubuntu distributions, but that is easy enough to remedy:
sudo apt-get install chkconfig
Next we need to copy our generated coldfusion script to /etc/init.d:
sudo cp /opt/coldfusionX/bin/coldfusion /etc/init.d
At the top of the file ColdFusion made for us are some special directives for the chkconfig utility. Chkconfig will look for these and automatically set where ColdFusion needs to be stopped and started. It looks something like this:
#!/bin/sh # chkconfig: 345 90 14 # description: starts the ColdFusion MX server
Finally, run the chkconfig utility to add ColdFusion service to the list of services run at boot:
sudo chkconfig --add coldfusion
I was later informed that these instructions do not work on Ubuntu 8.04. A user found a way around the issue:
Found it and it works!
Create a link to coldfusion in the init.d folder:
sudo ln -s /opt/coldfusion8/bin/coldfusion /etc/init.d/coldfusion
sudo update-rc.d coldfusion defaults
Easy-Peasy! Even if I have no idea what running update-rc.d actually does…