Force ID of user created by apt-get

Posted by Bart van Heukelom on Server Fault See other posts from Server Fault or by Bart van Heukelom
Published on 2012-06-19T14:54:06Z Indexed on 2012/06/19 15:18 UTC
Read the original article Hit count: 230

Filed under:
|
|
|

Context:

I'm automatically installing postgresql-9.1 on an Ubuntu server with apt-get. This creates the required postgres user.

The Postgres data is on an external volume that survives reinstalls. This data is obviously owned by the postgres user.

The problem I'm having is that the ownership is not recorded under the name postgres, but under the UID that postgres had at creation time. When the server is reinstalled, postgres sometimes gets a different UID, and no longer owns the data directory, and thus does not work.


Question:

Can I force the UID of the user postgres created by apt-get to something fixed? Or is there another way to solve my problem?


(As you may have deduced, this is on Amazon EC2 with the data on an EBS volume)

© Server Fault or respective owner

Related posts about linux

Related posts about ubuntu