About the pid and opts files

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема About the pid and opts files
Дата
Msg-id Pine.LNX.4.21.0006231626400.484-100000@localhost.localdomain
обсуждение исходный текст
Ответы Re: About the pid and opts files  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-hackers
I'm making consistent accessor functions to all of the special file names
used in the backend (e.g., "pg_hba.conf", "pg_control", etc.) and I got to
the pid file stuff. I'm wondering why you call the SetPidFile and
SetOptsFile functions twice, once in pmdaemonize() and once in the
non-detach case. It seems to me that you would get the same thing if you
just did:

if (silentflag)   pmdaemonize(); /* old version */

SetPidFile(...);
on_proc_exit(UnlinkPidFile, NULL);
SetOptsFile(...);

Is there anything special you wanted to achieve with this?

Furthermore, with the new run-time configuration system there will be a
fairly volatile set of possible options to the postmaster (and perhaps
more importantly, not all options are necessarily from the command line),
so the SetOptsFile function will need some rework. I think instead of
teaching SetOptsFile about each option that the postmaster might accept we
could just do

for (i=1; i<argc; i++)
{   fprintf(opts_file, "'%s' ", argv[i]);
}

The result wouldn't look as pretty as it does now but at least it would
always be correct. Comments?


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Interesting mention of PostgreSQL in news
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Big 7.1 open items