LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-27-2010, 08:37 PM   #1
Alan87i
Member
 
Registered: Oct 2005
Location: Quebec
Posts: 118

Rep: Reputation: 15
Script to run at Boot for Auto Mysql database check


I'm running zoneminder on Ubuntu 9.10
Even with a UPS the power quite often fails enough that I need to drive over bring home the computer and run
( mysqlcheck --all-databases --auto-repair -p )
Then enter my user PW then my Mysql PW. Both are the same.
How ever if it were possible to create a script that could run at start up I could get anyone to cycle the power and let it fix it's self.

Looking for some help with this as I have not a clue where to start.
Thanks
Allan
 
Old 10-29-2010, 05:06 AM   #2
feinbein
Member
 
Registered: Jan 2010
Location: Norway
Posts: 76

Rep: Reputation: 12
Can you not set up ssh and log yourself in remotely? That way at least you dont have to drive over.
Otherwise have a look into update.rc and startup-scripts.
It is off course a bit risky to write your password in cleartext in the script.
 
Old 10-29-2010, 07:18 AM   #3
Alan87i
Member
 
Registered: Oct 2005
Location: Quebec
Posts: 118

Original Poster
Rep: Reputation: 15
I have 2 systems running 9.10 ubuntu. I have ssh and rdp setup . Well I did. after about 2 weeks neither box will let me in. "connection refused" error.
I brought one system home the other day. Both are suppose to be stand alone box's no mouse key board or screen.
Rundown on rdp.
The only way I could get RDP to even work was to set the systems to auto login. And either plug in a powered off screen or stab 3 resistors in the correct holes on the vga port so the system thinks there's a screen attached.

When I booted the one I brought home I had to login. My settings were all still in tact. But none the less I still could not make it auto login or ssh or RDP.
I made a remastered copy of the drive when I first loaded it so I reloaded this 1 system and took it back this time with a screen and keyboard/mouse.
So far after 18 hours I can still login.
The other box is not letting me near it.
So that's my Beef SSH and or RDP is what I hoped for but seems it is not reliable at all.
Thanks for the reply.
Allan
 
Old 10-29-2010, 07:47 AM   #4
feinbein
Member
 
Registered: Jan 2010
Location: Norway
Posts: 76

Rep: Reputation: 12
RDP on linux? You are surely talking about vnc. I would not recommend vnc over wan. You can setup ssh passwordless with authorized keys which is save as long as you keep updated. You can then use a tunnel if you absolutely must have a gui.
It is correct that the vncserver in Ubuntu is in userspace and does only work when you are logged in with a user.
Anyway ssh is a very reliable service and I have a suspicion that your setup is the problem here.
Maybe your WAN has a dynamic ip and you are trying with the old ip? Are you using a firewall? Can you still access your cameras and the zoneminder website? Can you describe your network in detail?
 
Old 10-29-2010, 08:23 AM   #5
Alan87i
Member
 
Registered: Oct 2005
Location: Quebec
Posts: 118

Original Poster
Rep: Reputation: 15
I use VNC yes sorry.
The network is not the trouble I'm using PFsense and have total faith in my Nat forwarding. I forgot to mention that while connected to the local network with my laptop SSH still would not work or VNC.
I have both ZM box's configured with Static Leased IP's bound too there MAC address. And yes Zoneminder servers are both accessible over the web.
 
Old 10-30-2010, 02:48 AM   #6
feinbein
Member
 
Registered: Jan 2010
Location: Norway
Posts: 76

Rep: Reputation: 12
I suppose you have issued
Code:
/etc/init.d/networking restart
/etc/init.d/ssh restart
to begin with?
ssh starts in all runlevels?
Local firewall disabled?
You checked the correctness of the IP with ifconfig?
What error do you get when you try and login via ssh?
Another thing, you say you remastered. Maybe a problem with identical hostnames or even mac-addresses?
Just thoughts, I feel I can't really help you more without better detail of your network and setup.
Good luck!
 
Old 10-30-2010, 04:44 AM   #7
Alan87i
Member
 
Registered: Oct 2005
Location: Quebec
Posts: 118

Original Poster
Rep: Reputation: 15
AH I did not think to restart the shh service .
When I did I got the host key not found error , After generating a new one ssh worked fine.
I remastered each machine. Both have different host names Mac's and so on.

The other box use to let me in with ssh but just stopped for no known reason.
The error is ( the server unexpectedly closed the connection)
I bet it has the same problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot run auto shutdown script for oracle database inaki Linux - Newbie 1 03-18-2010 02:33 AM
What is a good way to have a script check with a licensing database? abefroman Programming 2 11-16-2009 02:59 PM
Loop or check SQlite3 database continuously, when query found run script for first 3 Techno Guy Linux - Newbie 3 09-27-2009 07:46 PM
Check server can access remote MySQL database, is this method reasonable?? helptonewbie Linux - Security 1 01-21-2008 09:15 AM
MySQL :: Auto backup all newly created database Swakoo Linux - General 3 01-22-2007 09:49 PM


All times are GMT -5. The time now is 09:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration