• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

MySQL Start at boot up

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux

View previous topic :: View next topic  
Author Message
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Fri Mar 14, 2003 7:20 pm    Post subject: MySQL Start at boot up Reply with quote

Hiya,

I have installed MySQL 3.23 on Slackware 8.1.

I am having difficulty encouraging MySQL to start at boot time.

If i execute it from CLI after system boot, it starts fine.

I have tried adding the following line to /etc/rc.d/rc.local:
/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &'

But it does not attempt to start it by the looks of things (rc.local is DEFINATLY being parsed at boot time).

I have also tried copying the mysql.server from the /usr/local/mysql/support-files directory to the /etc/rc.d/ directory, and running chmod 700 on it.

I have then added /etc/rc.d/mysql.server start to my /etc/rc.d/rc.M file, but the damn thing still wont start. if i cd into my rc.d directory, and run ./mysql.server start manually, it boots fine.

The log files do not even indicate an attempt was made to start the server if the command is in the startup files.

Any ideas?

Jason


Last edited by Jason on Sat Mar 15, 2003 3:37 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 3:34 am    Post subject: Reply with quote

THIS IS DRIVING ME NUTS Twisted Evil Twisted Evil Twisted Evil Twisted Evil

if i cd to /etc/rc.d/ and run ./rc.local then MySQL will start as part of that script.

rc.local is referenced in rc.M, and other programs inside it will run on boot.

I have also tried moving the command in rc.local into rc.M and still no joy.

I have even tried running it as root by using " --user=root " to make sure it was not some stupid permissions problem.

Really need help with this one, as i am screwing I NEED HELP!?! I NEED HELP!?! I NEED HELP!?!

Any suggestions?
Anyone?
Anyone at all?


ANNOYED!?! ANNOYED!?! ANNOYED!?! ANNOYED!?! ANNOYED!?! ANNOYED!?!


Last edited by Jason on Sat Mar 15, 2003 3:41 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 3:41 am    Post subject: Reply with quote

Check you logs and see if there are any messages about error when you are booting.. I had a problem like that and it turned out to be an error in my rc.M startup script.

Also you might wanna paste or pm me your rc.M and rc.local scripts.

Try this.. when you boot put this at the start of rc.local
Code:

echo "in rc.local";
... (to the MySQL stuff)
echo "before MySQL";


also paste the last of your startup here so we can see it.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 3:48 am    Post subject: Reply with quote

rc.local wrote:
#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#

############################################################
# start portsentry at boot-time #
############################################################
#/usr/local/psionic/portsentry2/portsentry


#start MYSQL

echo "Before My SQL";
/bin/sh -c 'cd /usr/local/mysql; ./bin/safe_mysqld --user=root &';
echo "After My SQL";

End of rc.M wrote:
# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
. /etc/rc.d/rc.local
fi


MySQL error file: /usr/local/mysql/data/london.err contains no new entries. (cleared it before putting server down for reboot).

My /var/log/messages and /var/log/syslog dont appear to contain any of the rc.d startup information..??? Should i turn on more logging in /etc/syslog.conf? if so, what?

Cheers,

Jason
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 3:56 am    Post subject: Reply with quote

What about you /var/log/errors?

And did the echo print? or no?

MySQL will put errors in to the syslog.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 4:04 am    Post subject: Reply with quote

squidly wrote:
What about you /var/log/errors?

And did the echo print? or no?

MySQL will put errors in to the syslog.



I dont have /var/log/errors.

Syslog didnt show anything. not even stuff like SSHD starting or apache starting. Maybe i am not logging enough? can you compare my syslog.conf to yours?

my /etc/syslog.conf file wrote:
# /etc/syslog.conf
# For info about the format of this file, see "man syslog.conf"
# and /usr/doc/sysklogd/README.linux.

# Uncomment this to see kernel messages on the console.
#kern.* //[b][/b]dev[b][/b]/console

# Log anything 'info' or higher, but lower than 'warn'.
# Exclude authpriv, cron, mail, and news. These are logged elsewhere.
*.info;*.!warn;\
authpriv.none;cron.none;mail.none;news.none /var/log/messages

# Log anything 'warn' or higher.
# Exclude authpriv, cron, mail, and news. These are logged elsewhere.
*.warn;\
authpriv.none;cron.none;mail.none;news.none /var/log/syslog

# Debugging information is logged here.
*.=debug /var/log/debug

# Private authentication message logging:
authpriv.* /var/log/secure

# Cron related logs:
cron.* /var/log/cron

# Mail related logs:
mail.* /var/log/maillog

# Emergency level messages go to all users:
*.emerg *

# This log is for news and uucp errors:
uucp,news.crit /var/log/spooler

# Uncomment these if you'd like INN to keep logs on everything.
# You won't need this if you don't run INN (the InterNetNews daemon).
#news.=crit /var/log/news/news.crit
#news.=err /var/log/news/news.err
#news.notice /var/log/news/news.notice



Ive just had another thought. I dont have a monitor plugged into my server, i am working soley via SSH, so an echo "etc.." wont show.

Any ideas how to make it write to syslog as each stage is met, as opposed to an echo command?


Last edited by Jason on Sat Mar 15, 2003 4:06 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 4:04 am    Post subject: Reply with quote

jasonlambert wrote:
rc.local wrote:
#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#

############################################################
# start portsentry at boot-time #
############################################################
#/usr/local/psionic/portsentry2/portsentry


#start MYSQL

echo "Before My SQL";
/usr/local/mysql/bin/safe_mysqld --user=root &
echo "After My SQL";



try that.. the CD could be causing the error



Also do you have a database at all? That coule be the error.

Also Im at work.. and have no access to my linux box right now.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 4:08 am    Post subject: Reply with quote

Squidly wrote:
Also do you have a database at all? That coule be the error.


Yes, i do have databases in there.



Code:
/usr/local/mysql/bin/safe_mysqld --user=root &


Didnt work either. No trace of any attempt to start it.
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 4:16 am    Post subject: Reply with quote

Hmm.. well did you try the rc.local I gave you..

Also why are you not logging you stuff starting up.. try adding a *.* /var/log/all and see if you actually are loggin anything.

Did your portsentry ever start up?? and is rc.local have permissions to execute for the world??

and is safe_mysqld have persmissions to run as well.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 4:28 am    Post subject: Reply with quote

squidly wrote:
Hmm.. well did you try the rc.local I gave you..

Also why are you not logging you stuff starting up.. try adding a *.* /var/log/all and see if you actually are loggin anything.

Did your portsentry ever start up?? and is rc.local have permissions to execute for the world??

and is safe_mysqld have persmissions to run as well.


i did use the rc.local you gave me.

i added a line for *.* /var/log/all and it gave me a lot of kernel messages, a message to say i had logged in via ssh, and a message telling me i had "su"ed. F'all about MySQL.

Portsentry starts up ok if i uncomment it, and works well.

For the safe_mysqld, i set the permissions as laid out in the manual:

shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .

and the file itself:
-rwxr-xr-x 1 root mysql 8593 Jan 21 21:18 safe_mysqld

edit:
just ran chmod 777 to give attributes: -rwxrwxrwx in case they were shagged.


The manual states:
Quote:
some operating systems also use ‘/etc/rc.local’ or
‘/etc/init.d/boot.local’ to start additional services on bootup. To start up MySQL using this method, you could append something like the following to it:
/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &'



Any other ideas?

(i bet you can see why this was stressing me out Laughing )
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 4:47 am    Post subject: Reply with quote

Im out of Ideas.. as If I was at home then I would be able to look at a few things.. How did you install it.. did you use the source or the slak tgz
Ill look at my linux box tonight and see if I can come up with anytning.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 4:50 am    Post subject: Reply with quote

Cheers mate.

I installed it from a tarball from one of the MySQL mirror sites, i think i got the "pre-made" executables though, not a build from source.

Jason


Last edited by Jason on Sat Mar 15, 2003 5:17 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 4:55 am    Post subject: Reply with quote

ok.. Tell you what Ill grab the slak package and look at it from there.
And see If I can help at all.

BBIAF
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 5:36 am    Post subject: Reply with quote

Ahh damn.. they didnt have the scripts in there...

Ill look at my box when I get home and let you know.. what I find
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Sat Mar 15, 2003 5:53 pm    Post subject: Reply with quote

Fixed it !!! Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy

2 Problems:

1) In my rc.M file i had somehow entered a tidle " ~ " after quotas which i think was causing a problem. Rolling Eyes

2) Then i worked out that MySQL would not start if it was started after apache. I really have no idea why. I put the command before apache and it works ok.

Thanks Squidly for your help. Wink

Jason Cool Cool
Back to top
View user's profile Send private message Send e-mail
squidly
Trusted SF Member
Trusted SF Member


Joined: 07 Oct 2002
Posts: 16777215
Location: Umm.. I dont know.. somewhere

Offline

PostPosted: Sat Mar 15, 2003 11:43 pm    Post subject: Reply with quote

No Problem.. glad I could help.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register