pgsql: Make it reasonably safe to use pg_ctl to start the postmaster

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Make it reasonably safe to use pg_ctl to start the postmaster
Дата
Msg-id 20090827165938.C308F75331E@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Make it reasonably safe to use pg_ctl to start the postmaster from a boot-time
script.

To do this, have pg_ctl pass down its parent shell's PID in an environment
variable PG_GRANDPARENT_PID, and teach CreateLockFile() to disregard that PID
as a false match if it finds it in postmaster.pid.  This allows us to cope
with one level of postgres-owned shell process even with pg_ctl in the way,
so it's just as safe as starting the postmaster directly.  You still have to
be careful about how you write the initscript though.

Adjust the comments in contrib/start-scripts/ to not deprecate use of
pg_ctl.  Also, fix the ROTATELOGS option in the OSX script, which was
indulging in exactly the sort of unsafe coding that renders this fix
pointless :-(.  A pipe inside the "sudo" will probably result in more
than one postgres-owned process hanging around.

Modified Files:
--------------
    pgsql/contrib/start-scripts:
        freebsd (r1.4 -> r1.5)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/start-scripts/freebsd?r1=1.4&r2=1.5)
        linux (r1.8 -> r1.9)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/start-scripts/linux?r1=1.8&r2=1.9)
    pgsql/contrib/start-scripts/osx:
        PostgreSQL (r1.3 -> r1.4)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/start-scripts/osx/PostgreSQL?r1=1.3&r2=1.4)
    pgsql/src/backend/utils/init:
        miscinit.c (r1.176 -> r1.177)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/init/miscinit.c?r1=1.176&r2=1.177)
    pgsql/src/bin/pg_ctl:
        pg_ctl.c (r1.111 -> r1.112)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_ctl/pg_ctl.c?r1=1.111&r2=1.112)

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

Предыдущее
От: mha@postgresql.org (Magnus Hagander)
Дата:
Сообщение: pgsql: exports.txt needs to use spaces as separators, not tabs, to work
Следующее
От: alvherre@postgresql.org (Alvaro Herrera)
Дата:
Сообщение: pgsql: Fix handling of autovacuum reloptions.