David Lee wrote:
On Fri, 18 Nov 2005, David Lee wrote:
[...]
Still bad. Still getting error return from setenv (-> OS putenv).
But I think I've found the problem area. The heartbeat code does
things directly with the (system provided) "environ" variable. One
such example is in "lib/clplumbing/setproctitle.c:set_proc_title()".
A local test commenting most of the heart of "set_proc_title()"
restores sanity: putenv() works cleanly and successfully. And that
means that heartbeat 2.0.x can actually now run on Solaris-8!
Clearly, the code's dabbling directly with environ can upset "putenv()"
on some OSes. I'll try to tidy this up.
"lib/clplumbing/setproctitle.c": In brief, I propose the attached
patch, to be added later this week, so that "PF_ARGV_TYPE ==
PF_ARGV_NONE" disables all the code.
Detail:
1. Hitherto, "init_set_proc_title()" does lots of dabbling with "argv"
and "environ", etc. for any setting of "PF_ARGV_TYPE", even
"PF_ARGV_NONE". This feels wrong: the "...NONE", I think, should
strongly imply "no dabbling, please".
2a. Solaris (Sun Microsystems) doesn't seem to offer any supported
(official) mechanism for changing the string as viewed by the default
"ps" ("/usr/bin/ps") command.
2b. Solaris's non-default "/usr/ucb/ps" flavour of "ps" (with the
right set of flags) does seem able to see such changes in other
programs, e.g. from sendmail. But only, it seems, on S9, not on
either S8 or S10!
3. sendmail's source is convoluted. But at a glance, it looks
somewhat cleaner that the version we have (ex-ProFTPD, I understand).
4. Tempted to switch to sendmail as our model source code?
(i) Would licensing allow us (heartbeat) to do that?
(ii) Is there any guarantee that Sun's sendmail corresponds to
sendmail's
own version? (Sun's version has had differences...)
All-in-all, chasing setproctitle-equivalent functionality seems to be
diminishing returns. The current implementation causes damage on
Solaris-8; we ought to have "PF_ARGV_NONE" working (and doing so with
intuitively "NONE" impact) anyway.
Does heartbeat software actually functionally use the result of
"setproctitle"? My guess it is simply "pretty printing", nothing
more, for human viewing of "ps" output.
Yes it is only for "pretty printing". The patch looks ok to me, if that
fixes your problem in S8.
thanks
-Guochun
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/