How to install services on OSX

If you have read the previous post about installing services on Linux (What, you haven’t? Do it now!), you will have a rough idea on how init and the rc.d scripts work. On OSX, launchd is the tool that replaces them both. launchd is invoked by the kernel while booting the system and takes care of managing the processes, just as init does. To interact with launchd there is a tool called launchctl, which will be used in this tutorial.

The daemon scripts are located at /Library/LaunchDaemons. Only the system administrator has the permissions to write there, so take into account that you will need admin rights to follow the next steps.

Write a properties file (which is a type of file with .plist extension that Apple uses for configuration), in /Library/LaunchDaemons. For example, let’s say we want the Drupal Stack to be started at boot time. We would create the file /Library/LaunchDaemons/com.bitnami-drupal.service.plist

<?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>com.bitnami-drupal.services</string> <key>ProgramArguments</key> <array> <string>INSTALLDIR/ctlscript.sh</string> <string>start</string> </array> <key>UserName</key> <string>root</string> <key>RunAtLoad</key> <true/>
<key>OnDemand</key> <false/> </dict> </plist>


Remember to substitute INSTALLDIR with your current installation path!

When you reboot the machine, the servers will be automatically started. Man, that was easy! If you prefer not to reboot, just use launchctl tool to start the service

launchctl load -w /Library/LaunchDaemons/com.bitnami-drupal.service.plist

To uninstall the service, type

launchctl unload -w /Library/LaunchDaemons/com.bitnami-drupal.service.plist

and delete the properties file
/Library/LaunchDaemons/com.bitnami-drupal.service.plist

so that it isn’t launched at boot time.

This is the end of the article. If you have comments or suggestions, please post at the following topic on the forums

http://bitnami.org/forums/forums/27/topics/366


Apr 28, 2008 | Tags: none

Comments

help

I am using Firefox on a Mac with system OSX 10.6.5 to design a web site in WordPress. I have installed Bitnami and am able to use it untill I shut down FireFox and reboot. After I reboot I am no longer able to establish a connection to the server at localhost:8080. I am very much a beginner at both WordPress and coding. I am confused as to what is happening and why. From what I have read it seems like I need to start the server using the program Terminal that is found in the Utilities folder on my Mac. But I am not sure what to do next. HOW to write a terminal, HOW TO save it and make Bitnami work again. And honestly not understanding why BItnami needs to be "turned on". Why is this not explained when you download the program. can anyone shed some light on this for me?? ANy new information would be greatly appreciated :(

help x2

I am having the exact same issue on the exact same system. I was very proud of myself until I rebooted the next day. Help would be much appreciated.

Same here.

This seems to be a common issue with this software. After I installed, I had no problems the first day. But when I went back to log-in today, it doesn’t find the localhost. I havent uploaded the wordpress files yet. Was only working locally. input: http://localhost:8080/wordpress/wp-login This is what I get.... Safari can’t open the page “http://localhost:8080/wordpress/wp-login” because Safari can’t connect to the server “localhost”. Any ideas?

Servers should be restarted after reboot

The servers included in the stack are not installed as services. You need to start the servers after rebooting your machine. In OS X you may do it from terminal or using our control panel. Please check: http://wiki.bitnami.org/Native_Installers_Quick_Start_Guide#How_can_start_or_stop_the_servers.3f This post describes the steps you can follow to make it start on its own on each boot. Please post your questions to our forums. That way, others can benefit from the answers.

Creating a plist file

I tried to follow the directions above. I used Text Editor to copy in the code, but I couldn't save it as a .plist file. I opened a .plist file and saw it had a drop down menu. Is there a way to do this within .plist or a suggestion for a different program to save a .plist file from?

Re: Creating a plist file

Once you created a file, you can go to the Terminal and try to rename it: mv your_file.txt your_file.plist. In any case we have recently included a graphical tool called "control", could you try to use it to start/stop the servers easily?

Servers started, now what?

Same difficulties. After rebooting my Mac, "localhost:8080" doesn't access my Bitnami stack. Followed all suggestions, nothing's working. My servers are started (green showing for both Mysql and Apache on Bitnami Control Panel) but how do I access my site locally after that?

Servers started, now what?

Same difficulties. After rebooting my Mac, "localhost:8080" doesn't access my Bitnami stack. Followed all suggestions, nothing's working. My servers are started (green showing for both Mysql and Apache on Bitnami Control Panel) but how do I access my site locally after that?

Please post to the forums

Please post your question to the forums

Servers started, now what?

Same difficulties. After rebooting my Mac, "localhost:8080" doesn't access my Bitnami stack. Followed all suggestions, nothing's working. My servers are started (green showing for both Mysql and Apache on Bitnami Control Panel) but how do I access my site locally after that?

Digg-icon Digg This Story    Reddit-icon Reddit!    Facebook-icon Join Our BitNami Group

Twitter-16x16 Follow Us On Twitter    Add to del.icio.us    Stumbleupon-icon Stumble It!