Bug 816633 - [as7] add support for specifying a start script prefix in the plugin configs for AS7 servers
[as7] add support for specifying a start script prefix in the plugin configs ...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.3
Unspecified Unspecified
high Severity high (vote)
: ---
: JON 3.1.0,RHQ 4.4.0
Assigned To: Charles Crouch
Mike Foley
:
Depends On:
Blocks: as7-plugin
  Show dependency treegraph
 
Reported: 2012-04-26 10:52 EDT by Ian Springer
Modified: 2015-02-01 18:28 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-31 06:09:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot (87.50 KB, image/png)
2012-06-01 08:24 EDT, Sunil Kondkar
no flags Details

  None (edit)
Description Ian Springer 2012-04-26 10:52:43 EDT
This allows users to specify a prefix for a start script execution initiated by the Start or Restart operation. The most common use case is needing to run AS7 as a different user than the RHQ Agent, in which case the prefix would be e.g. "sudo -u jboss" to run AS7 as the jboss user.

This should not take too long to implement, as we already have generic support for prefixes in ProcessExecutionUtility.createProcessExecution() in the plugin-api module.
Comment 1 Ian Springer 2012-04-26 10:55:34 EDT
Note, we support this in the as4 and as5 plugins, so we'll need it for feature parity in the as7 plugin.
Comment 2 Charles Crouch 2012-04-26 10:59:49 EDT
We should do this for RHQ4.4
Comment 3 Ian Springer 2012-04-28 17:17:16 EDT
Done in master:

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=4afaad5

Note, if an AS7 instance is running as a different user and/or group than the Agent, we detect this in autodiscovery and prepopulate the 'startScriptPrefix' prop with the appropriate sudo command line.
Comment 4 Sunil Kondkar 2012-06-01 08:23:42 EDT
Verified on Version: 3.1.0.CR1 Build Number: 4bc4270:1b85993

Started EAP6 instance with a different user than the agent (sudo -u skondkar). The instance is detected in autodiscovery and the 'Start Script Prefix' property in 'Inventory->Connection Settings' prepopulated with the value  '/usr/bin/nohup /usr/bin/sudo -u skondkar -g skondkar'.

Please refer the attached screenshot.
Comment 5 Sunil Kondkar 2012-06-01 08:24:13 EDT
Created attachment 588429 [details]
Screenshot
Comment 6 Ian Springer 2012-06-01 13:17:45 EDT
Sunil,

Did you also then try running the Start and Restart operations and verify that they worked and that the AS7 instance was running as skondkar:skondkar ?
Comment 7 Sunil Kondkar 2012-06-05 09:15:14 EDT
Hi Ian,

I Started agent with user 'testuser' and EAP6 instance with user 'skondkar'.

The operations start and restart worked and AS7 instance is running as skondkar:skondkar when I inserted below line in /etc/sudoers file:

testuser ALL=(skondkar:skondkar)      NOPASSWD: /store/EAP/EAP6/EAP6-ER8/jboss-eap-6.0/bin/standalone.sh
Comment 10 Heiko W. Rupp 2013-08-31 06:09:32 EDT
Bulk close of old bugs in VERIFIED state.

Note You need to log in before you can comment on or make changes to this bug.