Re: The function of lock file named ".s.PGSQL.<port>.lock" on Linux?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"xsun" <xu2002261@xxxxxxx> writes:
> When the psql server is started under Linux platform, in /tmp directory 
> there is a lock files named ".s.PGSQL.<port>.lock". So I want to know what 
> is the function of this lock file?

It prevents multiple postmasters from trying to use the same socket file.

> And does the server work well without 
> this lock file?

No.  (Well, it will run, but you have no protection against accidentally
starting another postmaster on the same port number.)

> Additionally, I know that the file ".s.PGSQL.<port>" is used as the unix 
> domain socket file. But the file ".s.PGSQL.<port>.lock" makes me still 
> pazzled. Could you explain that? Thanks.

We can't portably lock the socket file itself, so we make a separate
ordinary file for locking purposes.

			regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux