Skip to content

bin/shutdown.sh's output separates into multi-lines when existing more than one pid #13863

@Alioth4J

Description

@Alioth4J

Describe the bug
If there are more than one pids, when executing bin/shutdown.sh, the output will be separated to multi-lines.

Expected behavior

$ sh bin/shutdown.sh
The nacosServer(39511 40444) is running...
Send shutdown request to nacosServer(39511 40444) OK

Actually behavior

$ sh bin/shutdown.sh
The nacosServer(39511
40444) is running...
Send shutdown request to nacosServer(39511
40444) OK

How to Reproduce
Steps to reproduce the behavior:

  1. Start two nacos server instance.
  2. Run bin/shutdown.sh.
  3. See the output.

Desktop (please complete the following information):

  • OS: Fedora
  • Version nacos-server 3.0.2
  • Module bin

Additional context
The problem is caused by pgrep, which puts one pid in one new line. I think we can add | xargs after pgrep -f nacos.nacos to format the output.

This does not have functional issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions