Thread: Postmaster.pid - what do the various lines stand for?
Hi all, I have the file postmaster.pid - I would like to know what the lines mean? I did Google, but didn't find much. ====================================== [pol@localhost inst]$ more ./data/postmaster.pid 7382 /home/pol/Downloads/software/postgres/inst/./data 1430769205 5432 /tmp localhost 5432001 2195471 [pol@localhost inst]$ ======================================= "inst" is the base install of the PostgreSQL instance. 7382 is the process id of the .../inst/bin/postgres -D ./data process I'm curious as to what this line /home/pol/Downloads/software/postgres/inst/./data means The PostgreSQL install is in /home/pol/Downloads/software/postgres/inst/, but what does the bit of the path inst/./data - I'm unclear as to what the . (dot) in the middle of that path means. Is the 1430769205 a UNIX epoch time (seconds since 1970) since the instance started? 5432 is the port (configurable) /tmp - the PostgreSQL temp (sorting) directory? localhost is my machine name (never bothered to give it anything meaningful). It's the last line 5432001 2195471 that really puzzled me - I don't have a clue what they are about. I'd be grateful for any input on this matter, TIA and rgs, Pól Ua Laoínecháin -- linehanp@tcd.ie Mob: 00 353 86 864 5772
On Monday, May 4, 2015, Paul Linehan <linehanp@tcd.ie> wrote:
Inst/./data == inst/data
what does the bit of the path inst/./data - I'm unclear as to what the . (dot)
in the middle of that path means.
. (Dot) means the same directory - self-referencing
.. (Dot dot) means the parent directory
Inst/data/.. == inst
/tmp - the PostgreSQL temp (sorting) directory?
I think it is the location where the Unix socket is created. I think temporary files are created somewhere in the data directory.
David J.
Paul Linehan <linehanp@tcd.ie> writes: > Hi all, I have the file postmaster.pid - I would like to know > what the lines mean? I did Google, but didn't find much. This is defined in the source code in miscadmin.h: http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/miscadmin.h;h=c38993973856b13513e050f45c176bdd4e67160a;hb=HEAD#l425 > I'm curious as to what this line > /home/pol/Downloads/software/postgres/inst/./data > means > The PostgreSQL install is in /home/pol/Downloads/software/postgres/inst/, but > what does the bit of the path inst/./data - I'm unclear as to what the . (dot) > in the middle of that path means. As David noted, "." is just a self-reference to the current directory --- so it doesn't mean anything much. That tells us something about the script you're using to start the postmaster, though; possibly it's got an extra trailing slash on the PGDATA directory name. regards, tom lane
>> what does the bit of the path inst/./data - I'm unclear as to what the . >> (dot) >> in the middle of that path means. > . (Dot) means the same directory - self-referencing > .. (Dot dot) means the parent directory > Inst/./data == inst/data > Inst/data/.. == inst Yes, I'm fully aware of the . (dot) notation in Unix meaning the current directory. However, I'm confused as to why one would have a path ...../inst/./data and not just simply use ...../inst/data ? I've seen this when compiling MySQL and it's always puzzled me. Thanks for your input so far. Pól Ua Laoínecháin -- linehanp@tcd.ie Mob: 00 353 86 864 5772
> This is defined in the source code in miscadmin.h: > http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/miscadmin.h;h=c38993973856b13513e050f45c176bdd4e67160a;hb=HEAD#l425 Thanks for that Tom, I appreciate it. I'm just not sure what this part means * 7 shared memory key (not present on Windows) This corresponds to the line " 5432001 2195471" ====================================== [pol@localhost inst]$ more ./data/postmaster.pid 7382 /home/pol/Downloads/software/postgres/inst/./data 1430769205 5432 /tmp localhost 5432001 2195471 [pol@localhost inst]$ ======================================= I did Google "PostgreSQL shared key" and couldn't find anything significant - why are there two numbers? Pól Ua Laoínecháin > regards, tom lane -- linehanp@tcd.ie Mob: 00 353 86 864 5772
Paul Linehan <linehanp@tcd.ie> writes: > I'm just not sure what this part means > * 7 shared memory key (not present on Windows) > This corresponds to the line " 5432001 2195471" > I did Google "PostgreSQL shared key" and couldn't find > anything significant - why are there two numbers? It's just the way the SysV shared memory API works --- there's a "key" chosen by the application, and an "identifier" which is chosen by the kernel, but they're both just identifiers for a particular shared memory segment. "man 2 shmget" might be informative, or try "sudo ipcs -m" for a listing of SysV shared memory segments on your system. regards, tom lane