Hide Forgot
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
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.