[ 
https://issues.apache.org/jira/browse/SOLR-16191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534415#comment-17534415
 ] 

Mike Drob edited comment on SOLR-16191 at 5/10/22 3:47 PM:
-----------------------------------------------------------

So I think we could check that {{-p}} option is allowed and then use that 
instead of giving the potential pid as a positional argument. It looks like 
that option is supported by GNU (i.e. most Nix) and BSD (i.e. Mac).


was (Author: mdrob):
So I think we could check that {{-p}} option is allowed and then use that 
instead of giving the potential pid as a positional argument. It looks like 
that option is supported on nix and Mac.

> Sanity-check assumptions about Linux `ps` command in `solr/bin/solr` script
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-16191
>                 URL: https://issues.apache.org/jira/browse/SOLR-16191
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 9.0, 8.11.2, main (10.0)
>            Reporter: Michael Gibney
>            Priority: Minor
>
> SOLR-15558 made more apparent some assumptions/implicit dependencies on the 
> Linux {{ps}} command in the {{solr/bin/solr}} script. The script already 
> [disables running in 
> cygwin|https://github.com/apache/solr/blob/f5e927ed1ed9cb43ac843cac4e12b6edc1b8a904/solr/bin/solr#L58-L63]
>  because of utility version incompatibility, but perhaps we could 
> also/instead add "walks like a duck" sanity-check, e.g.:
> {code:sh}
> if [ "$$" != "`ps -o pid='' $$`" ]; then
>   exit 1
> fi
> {code}
> The issue arose while running {{gradlew :solr:packaging:integrationTests}} 
> for Alpine Linux with BusyBox {{ps}} installed, for which {{ps -o pid='' 
> $WHATEVER}} dumps all running pids, regardless of the value of {{$WHATEVER}}. 
> The behavior observed appeared mainly to affect {{solr stop}}, where the 
> command watches for the PID to exit, but the pid is never detected as having 
> exited. I'm not sure, it's possible that jstack/kill was being run against 
> random PIDs!



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to