Starting XBMC after Mysql server is started
#1
Hi,
I managed to configure MySQL and XBMC pretty well on my mac. However, when the mac starts, XBMC seems to launch before MySQL is on, resulting in the fact that my library is empty, until I restart XBMC. I was wondering if there was an apple script that could tell "if MySQL server is on, then open XBMC. If not, wait."
I'm a total noob with applescript so I don't really know how to write that. I would love some help! Thanks!
Reply
#2
(2013-01-18, 21:30)Vonspiel Wrote: Hi,
I managed to configure MySQL and XBMC pretty well on my mac. However, when the mac starts, XBMC seems to launch before MySQL is on, resulting in the fact that my library is empty, until I restart XBMC. I was wondering if there was an apple script that could tell "if MySQL server is on, then open XBMC. If not, wait."
I'm a total noob with applescript so I don't really know how to write that. I would love some help! Thanks!

This might help. Did you install the StartupItems for MySQL?
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#3
I'm using MAMP, so I don't know if the StartupItems are included in it.
Reply
#4
(2013-01-18, 23:31)Vonspiel Wrote: I'm using MAMP, so I don't know if the StartupItems are included in it.

This may resolve the issue for you: http://forum.mamp.info/viewtopic.php?p=661

Also, this may help as well: http://stackoverflow.com/questions/73267...em-startup
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#5
Thanks Winestock. However, I have no problem starting MAMP at startup. However, MAMP and XBMC starting at almost the same time, MAMP launches MySQL something like 2 or 3 seconds after XBMC launched. I just need a basic applescript that says if mysqld is running, then start XBMC... which I don't know how to write... because I suck at coding!
Reply
#6
(2013-01-19, 00:15)Vonspiel Wrote: Thanks Winestock. However, I have no problem starting MAMP at startup. However, MAMP and XBMC starting at almost the same time, MAMP launches MySQL something like 2 or 3 seconds after XBMC launched. I just need a basic script that says if mysqld is running, then start XBMC... which I don't know how to write... because I suck at coding!

Open the activity monitor and look at the processes running to see if you can determine the name of the MAMP process. Once you have that you can use that to determine when the MAMP is running in a shell script. Something like this:

Code:
#!/bin/sh

# The MAMP process name.
processName=mysqld

while (true)
do
    # Check the process list for the MAMP process.
    ps -ea | grep ${processName} | grep -v grep 2>&1 >/dev/null

    # Has MAMP started running yet?
    if [ $? -eq 0 ]
    then
        # Stop looking as MAMP is now running.
        break
    fi

    sleep 10
done

# Start XBMC
open /Applications/XBMC.app

You will need to replace "processName=mysqld" with the proper name of the MAMP process. I think you get the idea from here.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#7
Ha ha thanks!
The process name is also mysqld. However, when I want to save this script, AppleScript Editors tells me "Syntax Error - Expected end of line, etc. but found "while".
Reply
#8
(2013-01-19, 00:42)Vonspiel Wrote: Ha ha thanks!
The process name is also mysqld. However, when I want to save this script, AppleScript Editors tells me "Syntax Error - Expected end of line, etc. but found "while".

The script is a shell script not an apple script. Copy the code into a text editor and save the script off with a .sh extension. Make sure the premissions on the shell script are 755 "chmod 755 name.sh". You then can execute it from within a LaunchAgent plist file.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#9
My bad! Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Starting XBMC after Mysql server is started0