Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Different uid 's on different machines ?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
ats2
Apprentice
Apprentice
Posts: 297
Joined: Fri Apr 22, 2005 9:56 am

Different uid 's on different machines ?

  • Quote

Post by ats2 » Thu Feb 12, 2009 10:14 pm

Hi,
I've met today something strange. I have a bunch of gentoo servers, and all of them have the same uid 's for basic accounts, like fcron et tcpdump, namely 101 and 102.
But I discovered that on two new servers, these uid's have been switched, which causes rather strange things when synching file between these boxes (more precisely virtual servers with a mysql account inside). When I rsync (with -avzH) these files from A to B, uid's are swapped so that mysql inside the virtual server has a wrong uid. Which prevents it launching correctly.

Funny, eh?

So I have two questions :
1) How come that these uid's are different on two new/freshly installed machines ?
2) Isn't there some sort of consistency for these important uids in time ? Will it happen again on other machines ?

Thanks for your help on that matter, rather important for me.

ATS2
Top
Sadako
Advocate
Advocate
User avatar
Posts: 3792
Joined: Thu Aug 05, 2004 5:50 pm
Location: sleeping in the bathtub
Contact:
Contact Sadako
Website

  • Quote

Post by Sadako » Thu Feb 12, 2009 10:43 pm

When you add a new user yourself, the uid's are assigned first come, first serverd, starting at 1001.

New users added by portage work excatly the same, only starting from 101 (albiet certain daemons are assigned specific UID's, such as sshd and mysql).

What you've encountered simply implies the daemons in question (fcron and tcpdump ?) were emerge in a different order on the two different boxes, leading to different UID's.

You can change this if you really want, unmerging, deleting the user, and then re-installing in the correct order on one box would be one way, or just user `usermod -u UID user`, playing a little musical chairs with it.

Either way you'll need to change the ownership of the files owned by the user, although the first method (re-emerging) will involve a little less work here (I'd go with the second though).
`find / -uid` will be of help here, and don't forget to have a look at the GID's too.
"You have to invite me in"
Top
ats2
Apprentice
Apprentice
Posts: 297
Joined: Fri Apr 22, 2005 9:56 am

  • Quote

Post by ats2 » Thu Feb 12, 2009 11:01 pm

Hopeless wrote:When you add a new user yourself, the uid's are assigned first come, first serverd, starting at 1001.

New users added by portage work excatly the same, only starting from 101 (albiet certain daemons are assigned specific UID's, such as sshd and mysql).

What you've encountered simply implies the daemons in question (fcron and tcpdump ?) were emerge in a different order on the two different boxes, leading to different UID's.

You can change this if you really want, unmerging, deleting the user, and then re-installing in the correct order on one box would be one way, or just user `usermod -u UID user`, playing a little musical chairs with it.

Either way you'll need to change the ownership of the files owned by the user, although the first method (re-emerging) will involve a little less work here (I'd go with the second though).
`find / -uid` will be of help here, and don't forget to have a look at the GID's too.
Thanks for the answer. I thought those uid's were fixed inside each distribution. I was wrong. Your explanation makes it clear.
Thx.

ATS2
Top
Post Reply

3 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic