LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-17-2010, 09:56 AM   #1
griffey
Member
 
Registered: Jan 2004
Location: East Central Illinois
Distribution: RHEL 4/5/6 and Fedora
Posts: 89

Rep: Reputation: 15
"Lost" user mysql while updating system


Hi folks.

I had a weird occurrence yesterday and thought I'd pick your collective brains to gain more insight as to what the heck happened.

I ran up2date yesterday and it installed a few new MySQL packages as well as a new kernel.

It got through everything up until it went to install the smp version of the kernel, and up2date spit an error at me and quit.

The problem was that my system keeps old kernels and /boot was full, so it couldn't add the new files there. No problem--I manually removed (via rpm -e) six or seven of the old kernel packages (there might have been a dozen or so), ran up2date again, and it successfully installed the new kernel. Great. So I rebooted the system.

And when it came back up... MySQL didn't start. Huh?

I tried to manually start it just to see, and was greeted with "chown: 'mysql:mysql': invalid user" Yikes! Sure enough, a look at /etc/passwd showed NO user "mysql." I quickly tried "useradd mysql" but it wouldn't go for that because there was a GROUP mysql.

I checked to make sure that there was no user with an id matching the group id of mysql and then manually added mysql back to /etc/passwd and /etc/shadow.

After doing that I was able to start the MySQL daemon and it now properly starts up and runs fine after rebooting.

So basically, it's fixed, but I still don't exactly understand what the heck happened. Updating to a new MySQL rpm and having up2date fail while installing a new kernel somehow deletes my "mysql" user from the system? I shouldn't have to be manually modifying /etc/passwd and /etc/shadow because of an up2date error, I wouldn't think.

If anyone has any ideas, I'd love to hear them.

Thanks!

Edit-- This is a RHEL 4 system now running 2.6.9-89.0.20.ELsmp on a Dell PowerEdge 1750..

G.--

Last edited by griffey; 02-17-2010 at 09:59 AM. Reason: Added system information
 
Old 02-17-2010, 10:01 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I can't say exactly why the user was deleted - perhaps it had something to do with the fact the MySQL install RPM tries to add the user or maybe there is a different default user for new install?

However, I can say there is a way to add a user without doing the RedHat (Fedora/CentOS) default of adding a group. You use the "-n" option of useradd.

From man page:

Quote:
-n A group having the same name as the user being added to the system
will be created by default. This option will turn off this Red Hat
Linux specific behavior. When this option is used, users by default
will be placed in whatever group is specified in
/etc/default/useradd. If no default group is defined, group 1 will
be used.
 
1 members found this post helpful.
Old 02-17-2010, 10:08 AM   #3
griffey
Member
 
Registered: Jan 2004
Location: East Central Illinois
Distribution: RHEL 4/5/6 and Fedora
Posts: 89

Original Poster
Rep: Reputation: 15
Ahh! In my haste yesterday skimming through man pages I probably got as far as "group having the same name... created by default" and skipped to the next option.

I appreciate the tip!
 
  


Reply



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
after installing "ubuntu" lost the partitions that were earlier there in the system linusunis Linux - Newbie 2 06-19-2009 10:03 AM
Lost "Shutdown" and "Restart" From system menu in FC6 Nader1 Linux - Software 3 02-12-2007 04:40 PM
Repeated System Failure with "Lost Interrupt" error. codedv Linux - Hardware 3 07-24-2006 03:54 AM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM
"User" & "System" CPU load difference JJX Linux - General 3 06-06-2004 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration