Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[PROBLEM] MySQL Connection On Boot
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: MySQL Connection On Boot
9th Feb, 2013, 08:47 PM
Post: #1
Swiss Offline
Registered
Posts: 2
Joined: Feb 2013
Reputation: 0
MySQL Connection On Boot
Morning All,

I'll start with this as a configuration query rather than a bug as is more likely to simply be I've done something wrong Undecided

Setup:
1x D-Link Share-Centre NAS
1x Debian Server Running MySQL
1x Windows 7 Ultimate PC
2x Raspberry Pi Model B 512Mb

Media is on the NAS
XBMC database is on the Debian Server Setup From Here
Raspberry Pi are both running XBian Alpha 4 + Frodo 12 Update From Here
XBMC 12.0 Git:20130127-fb595f2 is the current version on all Devices

Firstly and probably a little strange, everything work perfectly. All devices share the database, I can updated it from my PC and the PIs just work.

However the PIs always need a kick when powered on or rebooted because they cant find the MySQL DB (Log Below)
To get the PIs working all I need to to is SSH in and run /etc/init.d/xbmc restart and boom all is good in my world, however this is just a little irritating Big Grin

Initial thought was, ok it's not waiting for the network...
Updated /etc/init.d/xbmc
Modified
Terminal
# Required-Start: bootlocal
To
Terminal
# Required-Start: bootlocal $network $named $remote_fs
And
Terminal
# Required-Start: $all
Run update-rc.d accordingly - no change

Tweaked /etc/init.d/xbmc
Terminal
### END INIT INFO

sleep 10

DESC=XBMC
Now my Pi boots, twiddles its fingers for a few moments, carries on and everything is good.

Obviously this isn't the best solution because when I come to do the next update I will have completely forgotten about this and it will all implode again. Is there a blatantly obvious setting that I'm missing to handle this ??

------------------ XMBC Log From Boot Up------------------------
Log Details
Find all posts by this user
Quote this message in a reply
9th Feb, 2013, 09:14 PM
Post: #2
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: MySQL Connection On Boot
First of all, please post your logs on pastebin as stated in our forum rules.

Quote:Than copy the whole text from screen to clipboard. Upload the file on the services like http://pastebin.com/ and post the link in your post/thread.
Do NOT post the raw text file from log directly on the forum! The log has a lot of lines of text and if this would be posted directly in your post/thread it makes it difficult to read/search your post through all the lines.

Second, bootlocal is already depends on $all so no need to change the dependency of XBMC.

I'm also running my xbmc with an external mysql library and it just works out of the box. Does your debian machine go to sleep or something?

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
9th Feb, 2013, 09:46 PM
Post: #3
bacobart Offline
Registered
Posts: 27
Joined: Jan 2013
Reputation: 2
RE: MySQL Connection On Boot
I think xbmc's just having trouble resolving 'cdnsvr02' to an ip address, maybe xbmc starts before the dns server can be reached. Try adding cdnsvr02 to /etc/hosts with the fixed ip address and see if that helps, or reconfigure the advancedsettings.xml to use the ip instead of the hostname.
Find all posts by this user
Quote this message in a reply
20th Feb, 2013, 05:23 AM
Post: #4
Swiss Offline
Registered
Posts: 2
Joined: Feb 2013
Reputation: 0
RE: MySQL Connection On Boot
Firstly - apologies on the Log, edited and dealt with.

None of my Debian servers, nor the ESX that hosts them sleep.
It's not a DNS issue as I get the same error if i change the xbmc config to the MySQL Server IP Address instead.

Done some more digging and it's defiantly underlying network that's the cause, although still highly likely that I'm to blame Tongue

Additional Setup Info
Debian server CDNSVR01 handles, among other things, DHCP & DNS via dnsmasq.

If I tail syslog on the CDNSVR01 the entries for the PI requesting it's DHCP lease occur after XBMC has already loaded. Add the delay back in and DCHP completes before XBMC loads.

So my next logical question is...
If XBMC has a dependency for bootlocal, bootlocal depends on $all and $all includes $network $named & $remote_fs why is XBMC loading before the network has finished starting up ?

Sorry if the answers really obvious, but I've only recently started playing Linux based OS so I'm still finding my feet.

Cheers,
Swiss.
Find all posts by this user
Quote this message in a reply
15th May, 2013, 03:54 PM
Post: #5
connorpb Offline
Registered
Posts: 1
Joined: May 2013
Reputation: 0
RE: MySQL Connection On Boot
I'd like to add that I have the same problem that Swiss did - not sure if you've solved it Swiss, but if you did I'd love to hear how!

Same deal - Xbian starts without network activity, can't connect to the MySQL database, logs show network connectivity after connection errors by timestamp. SSH restart of XBMC resolves the issue, as the network connection has established by then.

Of note, my Pi is wireless - could the wifi networking not be accounted for in the boot dependencies?
Find all posts by this user
Quote this message in a reply
19th May, 2013, 08:55 AM
Post: #6
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: MySQL Connection On Boot
swiss you have cable connected or wifi ?

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  Boot USB - No Network Connection kgoerbig 10 27,291 28th Jul, 2014 01:21 AM
Last Post: IriDium

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 9th May, 2025, 10:50 PM Powered By MyBB, © 2002-2025 MyBB Group.