This forum is no longer active. Please post your questions to our new community site

Forums Redmine

Launchd support for REDMINE under MacOSX

Subscribe to Launchd support for REDMINE under MacOSX 2 post(s), 2 voice(s)

 
Avatar cwoloszynski 1 post

I am trying to get launchd support working to Redmine will restart on reboot. I created a simple plist under /Library/LaunchDaemons to call ‘ctlscript.sh start’ on boot.

MySQL does not seem to start properly. I have used the user for the launch script as myself (as I installed the stack as myself) and as ‘root’. Neither seems to work.

Anyone have any suggestions on how to get this working?

Thanks,

Charlie

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Yes, the problem is that OS X services should be daemon process and ctlscript.sh is not a daemon script. When the script finishes, all process are killed. I would suggest to use two different plist files: one for Apache (which you can use “ctlscript.sh start apache” because Apache start as independent process of ctlscript.sh) and one for mysql similar to this:


<?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>mysql</string>
        <key>ProgramArguments</key>
        <array>
                <string>INSTALLDIR/mysql/bin/safe_mysqld</string>
                <string>--defaults-file=INSTALLDIR/mysql/my.cnf</string>
                <string>--port=PORT</string>
                <string>--socket=INSTALLDIR/mysql/tmp/mysql.sock</string>
                <string>--old-passwords</string>
                <string>--datadir=INSTALLDIR/mysql/data</string>
                <string>--log-error=INSTALLDIR/mysql/data/mysqld.log</string>
                <string>--pid-file=INSTALLDIR/mysql/data/mysql.pid</string>
                <string>--lower-case-table-names=1</string>
                <string>--default-table-type=InnoDB</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>_mysql</string>
        <key>GroupName</key>
        <string>_mysql</string>
</dict>
</plist>

It is important that you install the stack as root user.

I hope it helps.

Forums Redmine