Thank you Stephen for trying to answer my concern in substance!

My (possibly naiv) interpretation of the Sun document referenced in my
mail is that the command "/lib/svc/method/postgresql start" will be
run as "postgres" and if so, this arrangement has the same deficency
as my original SMF attempt (described in my message starting the
thread on the referenced PostgreSQL mail list) -- that is pg_start
(called in /lib/svc/method/postgresql in the Sun document) is run as
"postgres". pg_start itself will spawn the "top level" postmaster
process whereas in Tom Lane's example the initial postmaster process
is started (directly) by root (or daemon or whatever identity the
Linux startup scripts are started with -- I am not entirely sure about
this detail). Admittedly, I am just a casual user of SMF, so I may
miss here some important detail.

Thanks
Peter

On 2/14/07, Stephen Hahn <sch at eng.sun.com> wrote:
> * P?ter Kov?cs <peter.kovacs.1.0rc at gmail.com> [2007-02-14 12:28]:
> > I suspect that Sun's "official" documentation for PostgreSQL's SMF
> > integration
> > (http://www.sun.com/software/solaris/howtoguides/postgresqlhowto.jsp#2)
> > is not what the PostgreSQL folks would readily call "carefully
> > written":
> > http://archives.postgresql.org/pgsql-admin/2007-02/msg00169.php.
> >
> > The crux is that the "parent" postmaster process should be started by
> > a process which itself is not owned by the "postgres" user - if my
> > understanding of the PostgreSQL recommendation is correct. I do not
> > know how to achieve this behaviour with SMF, but I suspect that above
> > mentionned Sun documentation does not do it.
> >
> > Any comment appreciated.
>
>   Well, the latter post suggests
>
>   su -l postgres -c "/usr/bin/postmaster ... &" >> "$PGLOG" 2>&1 < /dev/null
>
>   so I would suggest using a start method with a method credential of
>   "postgres", with a duration of contract, would be equivalent.
>   (svc.startd is not running as the postgres user.)
>
>   This is in fact what the earlier reference suggests, as far as I can
>   see--it has method_contexts that select the postgres user.  (It does
>   appear to conflict with the separate IDs for separate postgres
>   instances.  Is that your concern?)
>
>   - Stephen
>
> --
> Stephen Hahn, PhD  Solaris Kernel Development, Sun Microsystems
> stephen.hahn at sun.com  http://blogs.sun.com/sch/
>

Reply via email to