Bug 1395673 - ntpd is not verbose for non-root user
Summary: ntpd is not verbose for non-root user
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ntp
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-16 12:16 UTC by Irina Gulina
Modified: 2017-06-23 08:40 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-23 08:40:38 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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