Description of problem: rhqctl not able to find new defined RHQ_AGENT_PIDFILE_DIR Version-Release number of selected component (if applicable): JON 3.2 How reproducible: Steps to Reproduce: 1. redirect the PID file to another directory in rhq-agent-env.sh RHQ_AGENT_PIDFILE_DIR="/opt/jboss/jon-agent/rhq-agent/pidfiledir" 2. ./rhqctl stop --agent 3. Agent will not stop with this script but it can be stopped with JON GUI Actual results: Agent is not stopping with this script but it can be stopped with JON GUI. Expected results: It should stop using ./rhqctl stop --agent Additional info: ./rhqctl start writes the pid file to the new RHQ_AGENT_PIDFILE_DIR, but it appears that ./rhqctl stop is only looking in the default directory, doesn't find a pid file for the agent and hence doesn't issue the kill
This bug affects also RHQ_SERVER_PIDFILE_DIR, neither is read in the rhqctl tool when trying to find the pidFile. Fixed in master 906b7ec
Setting to modified as this is in release/jon3.3.x
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993
The issue is still visible for RHQ_SERVER_PIDFILE_DIR ./rhqctl start --server works correctly and pid file is created in new location but ./rhqctl stop --server does not stop the server. Version : 3.3.0.DR01 Build Number : 6468454:dda0a47
The issue is still visible for RHQ_AGENT_PIDFILE_DIR as well
How are you verifying this? I can't replicate your failure: [michael@miranda bin]$ ./rhqctl status 19:09:13,398 INFO [org.jboss.modules] JBoss Modules version 1.3.0.Final-redhat-2 RHQ Storage Node (no pid file) is ✘down RHQ Server (no pid file) is ✘down JBossAS Java VM child process (no pid file) is ✘down RHQ Agent (no pid file) is ✘down [michael@miranda bin]$ mkdir ~/projects/jon/testpid/ [michael@miranda bin]$ export RHQ_AGENT_PIDFILE_DIR=~/projects/jon/testpid/ [michael@miranda bin]$ export RHQ_SERVER_PIDFILE_DIR=~/projects/jon/testpid/ [michael@miranda bin]$ ./rhqctl start 19:10:31,162 INFO [org.jboss.modules] JBoss Modules version 1.3.0.Final-redhat-2 INFO 19:10:31,582 Logging initialized Trying to start the RHQ Server... RHQ Server (pid 24545 ) is starting Starting RHQ Agent... RHQ Agent (pid 24917 ) is ✔running [michael@miranda bin]$ cat ~/projects/jon/testpid/rhq-server.pid 24545 [michael@miranda bin]$ cat ~/projects/jon/testpid/rhq-agent.pid 24917 [michael@miranda bin]$ ./rhqctl status 19:11:06,921 INFO [org.jboss.modules] JBoss Modules version 1.3.0.Final-redhat-2 RHQ Storage Node (pid 24305 ) is ✔running RHQ Server (pid 24545 ) is ✔running JBossAS Java VM child process (pid 24671 ) is ✔running RHQ Agent (pid 24917 ) is ✔running [michael@miranda bin]$ ./rhqctl stop --agent 19:11:13,424 INFO [org.jboss.modules] JBoss Modules version 1.3.0.Final-redhat-2 Stopping RHQ Agent... RHQ Agent (pid=24917) is stopping... RHQ Agent has stopped. [michael@miranda bin]$ ./rhqctl stop --server 19:11:22,008 INFO [org.jboss.modules] JBoss Modules version 1.3.0.Final-redhat-2 Trying to stop the RHQ Server... RHQ Server (pid=24545) is stopping... RHQ Server has stopped. [michael@miranda bin]$ ps x | grep 24917 25689 pts/2 S+ 0:00 grep --color=auto 24917 [michael@miranda bin]$ ps x | grep 24545 25694 pts/2 S+ 0:00 grep --color=auto 24545 [michael@miranda bin]$ As you can see, the pid is detected, put to the correct directory and also shutdown correctly (using the correct pid).
I cannot speak for Filip but one important difference from the reproducer steps and your steps is that the RHQ_*_PIDFILE_DIR value is being set in the env files and not in the user's or command's environment. For the agent this should be in rhq-agent-env and for the server, rhq-server-env.
Larry is right. I used following steps: 1 - jon is installed and running with default values 2 - rhqctl stop 3 - set RHQ_AGENT_PIDFILE_DIR in rhq-agent/bin/rhq-agent-env.sh and RHQ_SERVER_PIDFILE_DIR in jon-server-3.3.0.DR01/bin/rhq-server-env.sh 4 - rhqctl start 5 - [hudson@fbr-jon33-ora bin]$ ./rhqctl stop 04:34:56,092 INFO [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1 Stopping RHQ storage node... RHQ storage node (pid=25801) is stopping... RHQ storage node has stopped 6 - [hudson@fbr-jon33-ora bin]$ ./rhqctl status 04:39:55,255 INFO [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1 RHQ Storage Node (no pid file) is ✘down RHQ Server (pid 26018 ) is ✔running JBossAS Java VM child process (pid 26141 ) is ✔running RHQ Agent (pid 26325 ) is ✔running [hudson@fbr-jon33-ora bin]$ jps 27253 Jps 26325 AgentMain 26141 jboss-modules.jar The pid files are correctly created in new location after step 4: [hudson@fbr-jon33-ora bin]$ cat ~/rhq-agent.pid 26325 [hudson@fbr-jon33-ora bin]$ cat ~/rhq-server.pid 26018 [hudson@fbr-jon33-ora bin]$ cat ~/rhq-jvm.pid 26141
Fixed in master. However, I have to say I don't like this change at all, as the whole agent-env.sh / server-env.sh are opposite of the rhqctl movement. Instead of moving features to the rhqctl, we're now returning them back to the .sh scripts. We now have .properties files for some settings and these -env.sh files for some settings. I guess we want to support these -env.sh files still in JON 3.3 instead of moving the functionality? commit 33a783a0c715beac295419dfea97b7e6ec4e4dfd Author: Michael Burman <miburman> Date: Sat Aug 9 13:56:01 2014 +0300 [BZ 1112240] Remove pidfile detection from rhqctl and use rhq-agent-wrapper.sh / rhq-server.sh to do the logic of shutting down if necessary
commit fdc9ed38e04501bbf3a7edee65aec098c8dccca5 Author: Michael Burman <miburman> Date: Sat Aug 9 13:56:01 2014 +0300 (cherry picked from commit 33a783a0c715beac295419dfea97b7e6ec4e4dfd) Signed-off-by: Thomas Segismont <tsegismo>
(In reply to Thomas Segismont from comment #13) > commit fdc9ed38e04501bbf3a7edee65aec098c8dccca5 > Author: Michael Burman <miburman> > Date: Sat Aug 9 13:56:01 2014 +0300 > > (cherry picked from commit 33a783a0c715beac295419dfea97b7e6ec4e4dfd) > Signed-off-by: Thomas Segismont <tsegismo> ^^^ merged into release/jon3.3.x
Moving to ON_QA as available for test with the following brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=381194
Verified on Version : 3.3.0.ER02 Build Number : 4fbb183:7da54e2