Bug 1395673

Summary: ntpd is not verbose for non-root user
Product: Red Hat Enterprise Linux 6 Reporter: Irina Gulina <igulina>
Component: ntpAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.8   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-23 08:40:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Irina Gulina 2016-11-16 12:16:14 UTC
Description of problem:
if run 'service ntpd start|stop|restart|try-restart|reload|force-reload' as non-root user, no helpful message is shown. 

Version-Release number of selected component (if applicable):
RHEL6.8

How reproducible:
always

Steps to Reproduce:
1. as non-root user run 

service ntpd start|stop|restart|try-restart|reload|force-reload

Actual results: silence

>> service ntpd status
ntpd (pid  2635) is running...
>> service ntpd restart
>> service ntpd stop
>> service ntpd status
ntpd (pid  2635) is running..
>> service ntpd stop
>> echo $?
4


Expected results: verbosity, "permission denied" error: 
>> service ip6tables stop
ip6tables: Only usable by root.                          [WARNING]

>> service sshd stop
/etc/init.d/sshd: line 33: /etc/sysconfig/sshd: Permission denied
Stopping sshd:                                           [rm: cannot remove `/var/run/sshd.pid': Permission denied



Additional info:
/etc/rc.d/init.d/ntpd
start() {
        [ "$EUID" != "0" ] && exit 4

...
stop() {
        [ "$EUID" != "0" ] && exit 4

"In case of an error while processing any init-script action except for status, the init script shall print an error message ... https://fedoraproject.org/wiki/FCNewInit/Initscripts

Comment 2 Miroslav Lichvar 2017-06-23 08:40:38 UTC
I agree It would be nice to fix the init script to print an error message. However, RHEL 6 is already in the Production 3 Phase and this probably doesn't qualify as a critical issue. FWIW, in RHEL 7 systemd has replaced init scripts.