Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Conversation

@hyproman
Copy link

Running /etc/init.d/mono-xsp4 stop does not actually stop the running process because the commands used to detect the PID do not grab the entire PID. In my case (running Ubuntu 20.04), the correct PID being 899 was resolved to 89:

$ ps aux | grep -v grep | grep 'xsp4.exe'
www-data     899  0.1  0.5 286532 41724 ?        Sl   20:23   0:00 /usr/bin/mono /usr/lib/mono/4.5/xsp4.exe --port 8084 --address 0.0.0.0 --appconfigdir /etc/xsp4 --nonstop

$ ps aux | grep -v grep | grep 'xsp4.exe' | cut -c 10-15
    89

This fix reworks the command chain to use awk instead of cut to grab the whole PID.

Running `/etc/init.d/mono-xsp4 stop` does not actually stop the running process because the commands used to detect the PID do not grab the entire PID. In my case (running Ubuntu 20.04), the correct PID being `899` was resolved to `89`:

```$ ps aux | grep -v grep | grep 'xsp4.exe'
www-data     899  0.1  0.5 286532 41724 ?        Sl   20:23   0:00 /usr/bin/mono /usr/lib/mono/4.5/xsp4.exe --port 8084 --address 0.0.0.0 --appconfigdir /etc/xsp4 --nonstop
$ ps aux | grep -v grep | grep 'xsp4.exe' | cut -c 10-15
    89
```

This fix reworks the command chain to use `awk` instead of `cut` to grab the whole PID.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant