I'm trying to have a bash script stop jira, but I'm getting errors no matter which way I try. I'm trying to run sudo /opt/atlassian/jira/bin/stop-jira.sh or sudo /opt/atlassian/jira/bin/shutdown.sh and get this error:
PID file found but either no matching process was found or the current user does not have permission to stop the process. Stop aborted.
I switched to the root user which is what Jira runs as and I don't have any issues starting Jira with a bash script or running the equivalent commands to start it, but why does it not work when trying to stop Jira? How would I do this in a bash script?