When the "-Dinstall4j.pidDir=/var/run/nexus" property is added inside the "$install-dir/bin/nexus.vmoptions" then the "./nexus status" command does not function properly.
Following steps can be used to reproduce the issue locally.
1. Setup nexus "nexus-3.24.0-02" to run as service (as 'nexus' user). As mentioned in https://help.sonatype.com/repomanager3/installation/run-as-a-service
2. Verify everything works fine. So far all good.
3. Now as per the documentation try to define the "-Dinstall4j.pidDir=/var/run/nexus" property inside the $install-dir/bin/nexus.vmoptions
4. Create respective directory with correct permissions.
5. Now the 'status' command does not work properly (also the service stop command also does not work properly)
Although the nexus process is Up and running also the UI is also accessible.
Try removing the "-Dinstall4j.pidDir=/var/run/nexus" property inside the "$install-dir/bin/nexus.vmoptions " and then restart the nxrm3 process and validate again.