Bug 713526 - rhn_check executed as non-root (using sudo) fails satellite provisioning install
Summary: rhn_check executed as non-root (using sudo) fails satellite provisioning install
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning
Version: 540
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 462714
TreeView+ depends on / blocked
 
Reported: 2011-06-15 17:11 UTC by Mike
Modified: 2015-05-29 20:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-29 20:02:43 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed patch for /usr/share/rhn/spacewalkkoan.py (1.03 KB, patch)
2011-06-15 17:22 UTC, Mike
no flags Details | Diff

Description Mike 2011-06-15 17:11:53 UTC
Description of problem:

Configured a system for a remote kickstart.  Went in to the advanced options to configure the network for the kickstart, and chose the option to use current network configuration of eth0.

In order to get the server to pick up the remote kickstart more quickly, I executed (as non-root user):  sudo /usr/sbin/rhn_check

The rhn_check failed, as well as the attempt to provision the host remotely.

Version-Release number of selected component (if applicable):
RHN Satellite Server: 5.4.0
Remote host:  Red Hat 5.6 x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Schedule a remote kickstart of a server.
2. Choose to use static information from the Advanced Options page. (existing eth0 configuration, which is a static IP address, NOT DHCP) 
3. On the server that is being provisioned, execute (as non-root): sudo /usr/sbin/rhn_check
  
Actual results:

Get the following error:
[<redacted username>@<redacted servername> ~]$ sudo /usr/sbin/rhn_check

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.



[sudo] password for <redacted username>:
Preserve files! : []
sh: route: command not found
exceptions.IndexError
list index out of range
  File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 100, in initiate
    update_static_device_records(kickstart_host, static_device)
   File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 74, in update_static_device_records
    data = {"gateway": find_gateway(),\
   File "/usr/share/rhn/spacewalkkoan/spacewalkkoan.py", line 64, in find_gateway
    return response[0]


Expected results:

This command should execute as normal, and allow non-root user's (using sudo) to check in the system with rhn via /usr/sbin/rhn_check

Additional info:

Comment 1 Mike 2011-06-15 17:22:29 UTC
Created attachment 504911 [details]
Proposed patch for /usr/share/rhn/spacewalkkoan.py

Patch to path to /sbin/ to allow a non-root user (running command as sudo).

Comment 3 Tomas Lestach 2011-06-16 08:08:28 UTC
Please ignore Comment#2 ...

Preferred way is to use:
$ sudo -i /usr/sbin/rhn_check -vv


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