Skip site navigation (1) Skip section navigation (2)

RE: SHM ids (was running pgsql 7 under Jail'ed virtual machine on FreeBSD 4.2)

From: "Dave VanAuken" <dave(at)hawk-systems(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: RE: SHM ids (was running pgsql 7 under Jail'ed virtual machine on FreeBSD 4.2)
Date: 2001-01-06 02:58:33
Message-ID: DBEIKNMKGOBGNDHAAKGNCEPGCLAA.dave@hawk-systems.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-hackers
the jail can only address the PID's that operate within itself... in
effect allowing it to f'up its own enviroment only...  thus the
problem with pg trying to allocate dedicated portions of the
host/system wide memory.

will up the 7.0.2 to 7.1 and give her another go around.  Really would
like to work this within a jail'ed environment, but have much to much
code completed based on postgres to consider dumping it just because
of the functionality of the jail.

Dave

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
Sent: Friday, January 05, 2001 6:45 PM
To: Alex Pilosov
Cc: Dave VanAuken; pgsql-general(at)postgresql(dot)org
Subject: Re: SHM ids (was running pgsql 7 under Jail'ed virtual
machine
on FreeBSD 4.2)


I said:
> Alex Pilosov <alex(at)pilosoft(dot)com> writes:
>> I'd suggest you do this: add a global backend_shmid_offset in
ipc.c,
>> initialized to current default, and an option to postgres to put a
value
>> there.

> Don't waste your time.  This issue is gone in current sources.  See
> IpcMemoryCreate and IpcSemaphoreCreate in
src/backend/storage/ipc/ipc.c.

Actually, now that I think about it, you might still have a problem if
a "jail" is what I think it is.  The current code will step past an
existing shmem segment if it appears to be a non-Postgres memory
segment
or if it appears to belong to another running postmaster.  However,
the
test to see if the segment owner appears to be alive is

        /*
         * If the creator PID is my own PID or does not belong to any
         * extant process, it's safe to zap it.
         */
        if (hdr->creatorPID != getpid())
        {
            if (kill(hdr->creatorPID, 0) == 0 ||
                errno != ESRCH)
            {
		// segment belongs to a live postmaster, so continue
	    }
	}

So the question for you is, what will happen if kill() is given a PID
belonging to a process that's in a different "jail"?  Will it return
some kind of permission failure, or will it claim that there is no
such PID (ie, return ESRCH)?  If the latter, we still have a problem
...

			regards, tom lane


In response to

Responses

pgsql-hackers by date

Next:From: Valter MazzolaDate: 2001-01-06 03:01:58
Subject: replacing shmem
Previous:From: Peter EisentrautDate: 2001-01-06 02:54:19
Subject: Re: Beta2 ... ?

pgsql-admin by date

Next:From: Tom LaneDate: 2001-01-06 03:49:40
Subject: Re: RE: SHM ids (was running pgsql 7 under Jail'ed virtual machine on FreeBSD 4.2)
Previous:From: Alex PilosovDate: 2001-01-06 01:38:30
Subject: Re: SHM ids (was running pgsql 7 under Jail'ed virtual machine on FreeBSD 4.2)

pgsql-general by date

Next:From: Tom LaneDate: 2001-01-06 03:49:40
Subject: Re: RE: SHM ids (was running pgsql 7 under Jail'ed virtual machine on FreeBSD 4.2)
Previous:From: Ian deSouzaDate: 2001-01-06 02:57:03
Subject: DROP SEQUENCE ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group