XAMPP start in LaunchDaemons out of synch with Control Panel

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

XAMPP start in LaunchDaemons out of synch with Control Panel

Postby shannon@dftribe.net » 06. November 2010 23:29

Hello. I created a LaunchDaemon in Mac OS X 10.6 using LingOn to autostart XAMPP:

<dict>
<key>EnableTransactions</key>
<true/>
<key>Label</key>
<string>org.apachefriends.xampp.start</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/XAMPP/xamppfiles/xampp</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Applications/XAMPP/xamppfiles/</string>
</dict>


and it successfully launches all three apps. The issue is that after I log in, the XAMPP Control Panel does not recognize that MySQL has started. I have tracked down that the Daemon creates in ".../var/mysql/" the files xxxx.local.pid and xxxx.local.err; however, if I kill the Daemon initiated mysqld processes and start MySQL using the Control Panel, it creates xxxx.home.pid and xxxx.home.err

I assume this has something to do with why the Control Panel is not recognizing that MySQL has been started (Daemon uses local and Control Panel uses home).

If you can help me to get the two aligned, I would greatly appreciate it.

Kind regards,
Shannon
shannon@dftribe.net
 
Posts: 2
Joined: 06. November 2010 23:11

Re: XAMPP start in LaunchDaemons out of synch with Control P

Postby shannon@dftribe.net » 07. November 2010 04:27

I found the way to synchronize them.

Instead of creating one LaunchDaemon, I created three. And LingOn was giving me problems with the program attributes for MySql, so I ended up editing them all in Text Wrangler. Here are my three LaunchDaemons located in /Library/LaunchDaemons on Mac OS X 10.6 with XAMPP 1.7.3

filename = xampp.startapache.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>EnableTransactions</key>
<true/>
<key>Label</key>
<string>xampp.startapache</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/XAMPP/xamppfiles/xampp</string>
<string>startapache</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Applications/XAMPP/xamppfiles</string>
</dict>
</plist>


filename = xampp.startftp.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>EnableTransactions</key>
<true/>
<key>Label</key>
<string>xampp.startftp</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/XAMPP/xamppfiles/xampp</string>
<string>startftp</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Applications/XAMPP/xamppfiles</string>
</dict>
</plist>


filename = xampp.startmysql.plist

Note: On two lines it has xxx.yyy, which you should find in System Preferences / Sharing / File Sharing
If you are using XAMPP's FTP program, then you probably want to enable File Sharing and in Options enable AFP and possibly Windows sharing but disable FTP.
With these options set as described, on the File Sharing tab below where it says File Sharing: On, you will see AFP://xxx.yyy/
Replace xxx.yyy on the two below lines with what you find (i.e. xxx.yyy.pid and xxx.yyy.err) (e.g. mymac.home.pid)

<?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>EnableTransactions</key>
<true/>
<key>Label</key>
<string>xampp.startmysql</string>
<key>Program</key>
<string>/Applications/XAMPP/xamppfiles/bin/mysqld_safe</string>
<key>ProgramArguments</key>
<array>
<string>--basedir=/Applications/XAMPP/xamppfiles</string>
<string>--datadir=/Applications/XAMPP/xamppfiles/var/mysql</string>
<string>--pid-file=xxx.yyy.pid</string>
<string>--log-error=xxx.yyy.err</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Applications/XAMPP/xamppfiles/</string>
<key>UMask</key>
<integer>7</integer>
</dict>
</plist>


With these three LaunchDaemons saved, restart your Mac. You should find all three services running when you log in again and open the XAMPP Control Panel.

Some may elect to add a key called "KeepAlive" that keeps the service running no matter what happens. I elected not to include this key because as a developer I may want to stop a service for a period of time as I do some maintenance and then restart it manually or have it restart automatically when I restart my Mac. I found that KeepAlive did just as described; I would manually stop the service and it would automatically start up again. Just thought I would mention it.

Hope this helps someone else.

Issue Resolved
Kind regards,
Shannon
shannon@dftribe.net
 
Posts: 2
Joined: 06. November 2010 23:11

Re: XAMPP start in LaunchDaemons out of synch with Control P

Postby vmorgan » 21. June 2011 23:42

This seemed to have no affect whatsoever. Services still are off when I login. I am trying to get them activated so that they don't need admin access to get the services running. Any help apprecaited this is for an educational setting.
Victoria Morgan
ITS Desktop Support
UCSC Extension
vmorgan
 
Posts: 2
Joined: 21. June 2011 23:31


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 74 guests