Bug 534387 (RHQ-1189)
Summary: | be able to boot agent as specific user | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | John Mazzitelli <mazz> | ||||
Component: | Launch Scripts | Assignee: | John Mazzitelli <mazz> | ||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Corey Welton <cwelton> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | unspecified | CC: | jpviragine, rsoares | ||||
Target Milestone: | --- | Keywords: | Improvement | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
URL: | http://jira.rhq-project.org/browse/RHQ-1189 | ||||||
Whiteboard: | |||||||
Fixed In Version: | 1.2 | Doc Type: | Enhancement | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | Type: | --- | |||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
John Mazzitelli
2008-11-26 19:32:00 UTC
I change the rhq-agent-wrapper.sh script like this: in function start: ... case "$1" in 'start') if [ "$RUNNING" = "1" ]; then echo $STATUS exit 0 fi echo Starting RHQ Agent... # force start with a specifc user if [ "x${RHQ_AGENT_RUN_AS}" != "x" ]; then RHQ_AGENT_START_SCRIPT="su -m - ${RHQ_AGENT_RUN_AS} -c '${RHQ_AGENT_START_SCRIPT}'" # this is beacause "$RHQ_AGENT_START_SCRIPT > /dev/null 2>&1" hide any OS message echo Enter password for ${RHQ_AGENT_RUN_AS} fi ... This work here! My env: OS: Linux Debian Jopr 2.1 JDK: 1.5 With this when a non root user execute rhq-agent-wrapper.sh the OS will ask for password. But this workaround is just for OS boot and in this case a root user is used. Nice. I'll put this on the list for 1.2 to see if we can incorporate it in the next release. Looks simple enough, we just have to test it on a bunch of platforms and make sure we aren't missing anything. we need to test this when: 1) running in foreground in a shell as one user and wanting to run the server as another user 2) running in foreground in a shell as one user and wanting to run the server as the same user 3) running in background as a boot job as one user and wanting to run the server as another user 4) running in background as a boot job as one user and wanting to run the server as the same user attaching a new wrapper.sh - work in progress but shows what the final solution is probably gonna look like. rhq-agent-env.sh is attached - comments tell you about the new variables I tried to keep the variable names consistent between the .bat and .sh scripts. i deleted the attachments from earlier. code is now checked in so you can see it there. you can run the agent as another user via rhq-agent-wrapper.sh - see the -comments in env.sh script for the different env vars that control this feature. see the wrapper script you would use to start as another user: http://svn.rhq-project.org/repos/rhq/trunk/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh here's the env.sh that have comments to describe the new vars: http://svn.rhq-project.org/repos/rhq/trunk/modules/enterprise/agent/src/etc/rhq-agent-env.sh UNIX doesn't have the RUN_AS_ME, RUN_AS settings. read the comments in the env.sh file for the new way to do this (RHQ_AGENT_START_COMMAND) QA Verified, this seems to work. I have tried running the agent in a variety of different valid (and invalid...) manners, across root and non-root users, with the server running as the same or as a different user. This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1189 Imported an attachment (id=368511) This bug relates to RHQ-1194 This bug relates to RHQ-1108 This bug relates to RHQ-1041 This bug relates to RHQ-2400 |