Re: [HACKERS] text patch -- sugg cmd when run as root

Поиск
Список
Период
Сортировка
От dg@illustra.com (David Gould)
Тема Re: [HACKERS] text patch -- sugg cmd when run as root
Дата
Msg-id 9804300628.AA24406@hawk.illustra.com
обсуждение исходный текст
Ответ на text patch -- sugg cmd when run as root  (Brett McCormick <brett@work.chicken.org>)
Ответы Re: [HACKERS] text patch -- sugg cmd when run as root  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-hackers
> When you run postgresql as root, the command it gives for putting in
> your startup script is a little weird.  The main issue is that 2>&1
> only works in bash, not tcsh.  >& works in both, so it seems
> preferable.  Another minor issue is that it echoes the command and
> pipes it through su.  Shouldn't this be "su - postgres -c 'cmd'"?  Do
> all versions of su have the '-c' argument?  piping it through seems
> weird, but maybe it isn't.
>
> this is a straight diff for src/backend/main/main.c
>
> --cut here--
> 38c38
> < echo \"postmaster -B 256 >/var/log/pglog 2>&1 &\" | su - postgres\n\n"
> ---
> > su - postgres -c 'postmaster -B 256 >& /var/log/pglog' &\n\n"
> --cut here--

You have tcsh as the root shell???

Seriously, most systems have 'sh' as the root shell, with bash a distant
second possibility. And, the '2>&1' syntax works in 'sh', and 'ksh' and 'bash'.

-dg

David Gould            dg@illustra.com           510.628.3783 or 510.305.9468
Informix Software  (No, really)         300 Lakeside Drive  Oakland, CA 94612
"(Windows NT) version 5.0 will build on a proven system architecture
 and incorporate tens of thousands of bug fixes from version 4.0."
                 -- <http://www.microsoft.com/y2k.asp?A=7&B=5>

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

Предыдущее
От: dg@illustra.com (David Gould)
Дата:
Сообщение: Re: [HACKERS] removing the exec() from doexec()
Следующее
От: dg@illustra.com (David Gould)
Дата:
Сообщение: Re: [HACKERS] Re: [PATCHES] S_LOCK reduced contention through backoff patch