Thread: PostgreSQL on system with root as only user

PostgreSQL on system with root as only user

From
"Fredrik Israelsson"
Date:
Hi!
I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist. I would prefer to use a
binary installer. Is it possible to install PostgreSQL without the
postgres user?

/Fredrik

Re: PostgreSQL on system with root as only user

From
"Harpreet Dhaliwal"
Date:
No, you can't.
You need postgres user for sure.
Postgresql database doesn't run on root account.

~Harpreet

On 8/30/06, Fredrik Israelsson < fredrik.israelsson@eu.biotage.com> wrote:
Hi!
I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist. I would prefer to use a
binary installer. Is it possible to install PostgreSQL without the
postgres user?

/Fredrik

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Re: PostgreSQL on system with root as only user

From
Chris Mair
Date:
> I am about to install PostgreSQL on a minimal Linux system, where root
> is the only user that is allowed to exist. I would prefer to use a
> binary installer. Is it possible to install PostgreSQL without the
> postgres user?

PostgreSQL refuses to start up as root user for security
reasons (this is a feature).

If you know what you're doing and you want to disable that
feature you need to recompile from source and disable the
uid checks in src/backend/main/main.c.

Unless you're working in the embedded space or some such thing,
I don't think it's a good idea, anyway.

Bye :)
Chris.


--

Chris Mair
http://www.1006.org


Re: PostgreSQL on system with root as only user

From
Tom Lane
Date:
"Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:
> I am about to install PostgreSQL on a minimal Linux system, where root
> is the only user that is allowed to exist.

You've *got* to be kidding.  That's possibly the stupidest system design
decision I've ever heard ... what is the point of disallowing non-root
userids?  It certainly can't improve system security to run everything
as root.

            regards, tom lane

Re: PostgreSQL on system with root as only user

From
"Fredrik Israelsson"
Date:
Well, no actual "design decision" is made yet. Just testing...

...actually, in embedded, minimalistic environments, I don't think it's
unusual to have one and only one user.

/Fredrik

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: den 30 augusti 2006 15:17
To: Fredrik Israelsson
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PostgreSQL on system with root as only user

"Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:
> I am about to install PostgreSQL on a minimal Linux system, where root

> is the only user that is allowed to exist.

You've *got* to be kidding.  That's possibly the stupidest system design
decision I've ever heard ... what is the point of disallowing non-root
userids?  It certainly can't improve system security to run everything
as root.

            regards, tom lane

Re: PostgreSQL on system with root as only user

From
Andrew Kelly
Date:
On Wed, 2006-08-30 at 09:17 -0400, Tom Lane wrote:
> "Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:
> > I am about to install PostgreSQL on a minimal Linux system, where root
> > is the only user that is allowed to exist.
>
> You've *got* to be kidding.  That's possibly the stupidest system design
> decision I've ever heard ... what is the point of disallowing non-root
> userids?  It certainly can't improve system security to run everything
> as root.


Remember the glory of heaven and earth before man was created?

;-)


>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq


Re: PostgreSQL on system with root as only user

From
Martijn van Oosterhout
Date:
On Wed, Aug 30, 2006 at 03:34:22PM +0200, Fredrik Israelsson wrote:
> Well, no actual "design decision" is made yet. Just testing...
>
> ...actually, in embedded, minimalistic environments, I don't think it's
> unusual to have one and only one user.

Yeah, but in embedded minimalisatic POSIX-compatable environment, I
imagine multiple users are somewhat of a requirement. It's not like a
UID costs anything, it's just a number...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: PostgreSQL on system with root as only user

From
AgentM
Date:
On Aug 30, 2006, at 9:01 , Chris Mair wrote:

>
> If you know what you're doing and you want to disable that
> feature you need to recompile from source and disable the
> uid checks in src/backend/main/main.c.
>
> Unless you're working in the embedded space or some such thing,
> I don't think it's a good idea, anyway.

Has anyone actually used PostgreSQL on an embedded system? I am
genuinely curious. How about db performance from a flash drive?

-M

Re: PostgreSQL on system with root as only user

From
"Brandon Aiken"
Date:
Unless it's a read-only database, I would never recommend using flash
media for an RDBMS.

Unless it's a small database, I would never recommend using USB as a
storage interface for an RDBMS.

--
Brandon Aiken
CS/IT Systems Engineer
-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of AgentM
Sent: Wednesday, August 30, 2006 10:42 AM
To: PostgreSQL General ML
Subject: Re: [GENERAL] PostgreSQL on system with root as only user


On Aug 30, 2006, at 9:01 , Chris Mair wrote:

>
> If you know what you're doing and you want to disable that
> feature you need to recompile from source and disable the
> uid checks in src/backend/main/main.c.
>
> Unless you're working in the embedded space or some such thing,
> I don't think it's a good idea, anyway.

Has anyone actually used PostgreSQL on an embedded system? I am
genuinely curious. How about db performance from a flash drive?

-M

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: PostgreSQL on system with root as only user

From
AgentM
Date:
On Aug 30, 2006, at 12:03 , Brandon Aiken wrote:

> Unless it's a read-only database, I would never recommend using flash
> media for an RDBMS.

Well, it's an embedded device, so you can pretty much be certain that
it's not storing sales information. If the flash goes belly up, then
the device has failed anyway, so the lost info is the least of the
problems.

>
> Unless it's a small database, I would never recommend using USB as a
> storage interface for an RDBMS.

Why? Could you provide more details?

I would be interested in any performance numbers anyone has collected.

-M

Re: PostgreSQL on system with root as only user

From
"Brandon Aiken"
Date:
I haven't got any numbers (or a USB stick I can test with at the moment)
but USB is going to be a bottleneck for read and write performance.
Unless you're accessing very small amounts of data or running small
queries, I would expect performance to be pretty poor.

If your data set is so small, why do you need a full RDBMS instead of
flat data/text files or SQLite?  If you're not concerned about disk
media failure, why do you need a transactional DB?  It seems like
putting a deadbolt on a screen door.

It might work just great for your device, of course, but I would not
expect it to scale well at all.

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of AgentM
Sent: Wednesday, August 30, 2006 1:21 PM
To: PostgreSQL General ML
Subject: Re: [GENERAL] PostgreSQL on system with root as only user


On Aug 30, 2006, at 12:03 , Brandon Aiken wrote:

> Unless it's a read-only database, I would never recommend using flash
> media for an RDBMS.

Well, it's an embedded device, so you can pretty much be certain that
it's not storing sales information. If the flash goes belly up, then
the device has failed anyway, so the lost info is the least of the
problems.

>
> Unless it's a small database, I would never recommend using USB as a
> storage interface for an RDBMS.

Why? Could you provide more details?

I would be interested in any performance numbers anyone has collected.

-M

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: PostgreSQL on system with root as only user

From
AgentM
Date:
On Aug 30, 2006, at 13:58 , Brandon Aiken wrote:

> I haven't got any numbers (or a USB stick I can test with at the
> moment)
> but USB is going to be a bottleneck for read and write performance.
> Unless you're accessing very small amounts of data or running small
> queries, I would expect performance to be pretty poor.

Indeed, that's pretty much our scenario- a rack-mounted Linux box
storing mostly inconsequential data (auth creds) with a flash drive-
quasi-embedded, I guess.

>
> If your data set is so small, why do you need a full RDBMS instead of
> flat data/text files or SQLite?  If you're not concerned about disk
> media failure, why do you need a transactional DB?  It seems like
> putting a deadbolt on a screen door.

MySQL and SQLite have terrible concurrent performance with
transactions. We would also like to take advantage of database-level
replication instead of our fragile home-grown thing for load-sharing
and failover.

>
> It might work just great for your device, of course, but I would not
> expect it to scale well at all.

There are some things I can do- for example, fsync should probably
just be off. I guess I should simply go ahead and try it. Thanks for
the discussion!

-M