[HACKERS] semaphore usage "port based"?

Vivek Khera vivek at khera.org
Tue Apr 4 14:17:31 UTC 2006

On Apr 3, 2006, at 8:07 PM, Marc G. Fournier wrote:

> All PostgreSQL processes use "port * 1000" as their starting port  
> for semId ... if "port * 1000" is reported as in use, the first  
> thing that the PostgreSQL process does is kill(PID, 0) the PID  
> returned by semctl(GETPID) to see if, in fact, there is a process  
> running ... if not, PostgreSQL reuses that semaphore, if not, it  
> goes to (port*1000)+1, and tries again ... until it can find a free  
> semaphore that isn't in use ...

Perhaps you can hack into the postgresql master a flag that alters  
the "1000" parameter, or starts at a port * 1000 + N, then hard-code  
that flag into your startup script per jail.

More information about the freebsd-stable mailing list