Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need for the "nnrpd -s" hack: improve setproctitle() and fix /usr/ucb/ps on Solaris #53

Open
rra opened this issue Jul 17, 2021 · 3 comments
Labels
bug Something isn't working C: lib Related to libraries P: low Low priority
Milestone

Comments

@rra
Copy link
Contributor

rra commented Jul 17, 2021

Reported by eagle on 14 Dec 2008 07:43 UTC
Reported by Miroslaw Luc mirecki@nask.pl.

  1. ps reads all of the strings from argv, not just argv[0], to the nearest NULL. Setting argv[1] to NULL helps ps to read only argv[0].

  2. If the length of the initial args > argv[0] modified by setproctitle() then ps discards the latter and displays the initial args. The problem is that it is always true because of using SPACES in ovdb_monitor/ovdb_server and `-s' in nnrpd.

We should:

  1. Set argv[1] to NULL in setproctitle().
  2. Move the environment to malloc()'ed space to make a room for argv[0].
  3. Spawn nnrpd without `-s'.
  4. Remove SPACES from ovdb_init,monitor,server.

It's not clear if this is worth it; setproctitle() seems to be getting less and less popular.

@rra rra added C: lib Related to libraries P: low Low priority T: defect labels Jul 17, 2021
@rra rra self-assigned this Jul 17, 2021
@Julien-Elie
Copy link
Contributor

Does someone know if setproctitle() works with ps on Solaris 10 & 11?

@rra rra removed their assignment Jul 17, 2021
@Julien-Elie Julien-Elie added bug Something isn't working stalled Further information is requested and removed T: defect labels Nov 9, 2021
@Julien-Elie
Copy link
Contributor

Using /usr/ucb/ps -auxww on Solaris 10 and Solaris 11 shows the problem is still present:

$ /usr/ucb/ps -auxwww | grep nnrpd      
iulius   12698  0.0  0.0 8240 1664 ?        S 11:39:24  0:00 - nnrpd: acceptin  acceptin ceptin tin
iulius   12717  0.0  0.0 8376 1944 ?        S 11:40:09  0:00 - nnrpd: localhos  localhos calhos hos

And native ps auxww does not show the updated process title:

$ ps auxww | grep nnrpd
iulius   12790  0.0  0.0 8264 1024 ?        S 12:00:24  0:00 ./nnrpd -D -p 11119

Solaris 11.4 is currently announced to be supported by Oracle until 2034, so I keep this ticket open, and update its title.

@Julien-Elie Julien-Elie changed the title setproctitle doesn't work with /usr/ucb/ps on Solaris 8 & 9 setproctitle doesn't work with /usr/ucb/ps on Solaris Apr 15, 2023
@Julien-Elie Julien-Elie added this to the 2.8.0 milestone Apr 15, 2023
@Julien-Elie Julien-Elie changed the title setproctitle doesn't work with /usr/ucb/ps on Solaris Remove the need for the "nnrpd -s" hack: improve setproctitle() and fix /usr/ucb/ps on Solaris Apr 15, 2023
@Julien-Elie
Copy link
Contributor

Fixing that issue on Solaris will permit getting rid of the -s flag hack for nnrpd. Let's schedule it for the next major release.

@Julien-Elie Julien-Elie removed the stalled Further information is requested label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C: lib Related to libraries P: low Low priority
Development

No branches or pull requests

2 participants