RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 916168 - service ... status cluttered with bogus
Summary: service ... status cluttered with bogus
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: initscripts
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 816135
TreeView+ depends on / blocked
 
Reported: 2013-02-27 13:00 UTC by Karel Volný
Modified: 2016-11-25 12:59 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-13 15:37:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Karel Volný 2013-02-27 13:00:42 UTC
Description of problem:
The output of the service command was plain and simple in previous versions.
The output in recent versions is full of unnecessary cruft which hinders parsing the important information.
This breaks backward compatibility in various places and overwhelms admins with tons of information that can be easily obtained elsewhere, if needed.

Version-Release number of selected component (if applicable):
initscripts-9.42.1-1.el7

How reproducible:
always

Steps to Reproduce:
(let's use mysql as an example, install the package ...)
1. service mysqld stop
2. service mysqld status
3. service mysqld start
4. service mysqld status
  
Actual results:
2.
Redirecting to /bin/systemctl status  mysqld.service
mysqld.service - MySQL database server
          Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
          Active: inactive (dead)

úno 27 11:51:11 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Stopping MySQL database server...
úno 27 11:51:12 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[27659]: 130227 11:51:12 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
úno 27 11:51:12 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Starting MySQL database server...
úno 27 11:51:12 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[29353]: 130227 11:51:12 mysqld_safe Logging to '/var/log/mysqld.log'.
úno 27 11:51:13 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[29353]: 130227 11:51:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
úno 27 11:51:14 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Started MySQL database server.
úno 27 11:57:01 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Started MySQL database server.
úno 27 12:41:39 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Stopping MySQL database server...
úno 27 12:41:40 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[29353]: 130227 12:41:40 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
úno 27 12:41:40 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Stopped MySQL database server.


4.
Redirecting to /bin/systemctl status  mysqld.service
mysqld.service - MySQL database server
          Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
          Active: active (running) since St 2013-02-27 12:43:14 EST; 1s ago
         Process: 32699 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
         Process: 32674 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n (code=exited, status=0/SUCCESS)
        Main PID: 32698 (mysqld_safe)
          CGroup: name=systemd:/system/mysqld.service
                  ├─  389 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/v...
                  └─32698 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

úno 27 12:43:12 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[32698]: 130227 12:43:12 mysqld_safe Logging to '/var/log/mysqld.log'.
úno 27 12:43:12 pes-guest-90.lab.eng.brq.redhat.com mysqld_safe[32698]: 130227 12:43:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
úno 27 12:43:14 pes-guest-90.lab.eng.brq.redhat.com systemd[1]: Started MySQL database server.


Expected results:
(from RHEL6 / initscripts-9.03.38-1.el6)
2.
mysqld is stopped

4.
mysqld (pid  1486) is running...


Additional info:
looking into systemctl manpage, I do not see anything useful to control the verbosity, so this begs a RFE for systemd ...


as an example what exactly is broken by this, I can name our test /CoreOS/mysql/CVE-2007-3780 which compares the status before and after trying the reproducer to find out whether mysql is still running and it has the same PID - this is now impossible without some black magic because the command outputs not just time of start of the service but also delta to $now which of course differs between two subsequent calls (not talking about the possibility that something would get logged meanwhile, thus failing the comparison due to different logs)

Comment 2 Lukáš Nykrýn 2013-02-27 13:18:59 UTC
systemctl status is more in human readable format. Try to use systemctl show, especially with -p option.

Comment 4 Lukáš Nykrýn 2013-02-27 13:41:03 UTC
And if I am not mistaken old output was purely based on output of service's initscript, so it is not possible to provide the same output anymore.

Comment 5 Karel Volný 2013-02-27 15:17:33 UTC
(In reply to comment #2)
> systemctl status is more in human readable format. Try to use systemctl
> show, especially with -p option.

ahem, I'm talking about backwards compatibility of the "service" command

if "systemctl show" gives more traditional output then service should be changed to use that instead of "systemctl status" => reopening

- but one question comes to my mind here, does "show" report the same exit codes as "status"?

(In reply to comment #4)
> And if I am not mistaken old output was purely based on output of service's
> initscript, so it is not possible to provide the same output anymore.

good point

we should do some survey to find out the common behaviour and try to guess what is "the most expected"

even if we cannot get the exactly same output, we should try to get reasonably close to the original behaviour, to make the transition as smooth as possible (adding usability tracker bug #908726)

Comment 6 Lukáš Nykrýn 2013-02-27 16:57:06 UTC
> ahem, I'm talking about backwards compatibility of the "service" command
Well return codes should be still the same and service just print output of initscript, which was not strictly defined.

> if "systemctl show" gives more traditional output then service should be
> changed to use that instead of "systemctl status" => reopening
systemctl show does not show "traditional output". It is just much more usable in scripts.

> we should do some survey to find out the common behaviour and try to guess
> what is "the most expected"
> 
> even if we cannot get the exactly same output, we should try to get
> reasonably close to the original behaviour, to make the transition as smooth
> as possible (adding usability tracker bug #908726)

This would add yet another interface to work with. I really don't want to change this behavior, but I can add some addition info message or alter manpage.

We can't provide the exactly same output as in older rhels and if customers are supposed to modify their script, it would be better to use "native" systemd interface because it will bring less pain in the future.

Comment 7 Václav Pavlín 2013-03-12 13:21:50 UTC
I agree with Lukas - previous output could be inconsistent, which is now solved by using systemctl status output. If you need specific info about the service it is recommended to use systemctl show (-p).

I don't think adding another "pseudo-compatible" stuff is the right way.

Comment 8 Karel Volný 2013-03-12 14:38:43 UTC
(In reply to comment #7)
> I agree with Lukas - previous output could be inconsistent, which is now
> solved by using systemctl status output.

this "solves" completely different problem then I report here

> If you need specific info about the service it is recommended to use systemctl
> show (-p).

ditto, no, I do not need "specific info", I just want the *service* (not systemctl!) output to at least resemble what is common in RHEL6

> I don't think adding another "pseudo-compatible" stuff is the right way.

and we do not think that throwing away compatibility is the right way which is why we started the usability testing project

from bug #908726:

Usability maxims 
...
    Things that look the same should act the same.
    Don't overwhelm the user.
    Consistency, consistency, consistency.
    Minimize the need for a mighty memory.
    Keep it simple.
...

the current behaviour breaks all of these

I've just run a simple query on a RHEL6 system (see the output below) and with only a few exceptions the common output is

"service-name is stopped"

or

"service-name (pid NNNNN) is running..."

so if the new service wrapper would keep this form, it'd break only a small amount of cases - do you really see this as bigger evil then breaking EVERYTHING?



.qa.[root@x86-64-6s-m1 init.d]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.4 (Santiago)
.qa.[root@x86-64-6s-m1 init.d]# for i in * ; do echo "**** $i ****" ; service $i status ; done
**** abrt-ccpp ****
abrt-ccpp hook is not installed
**** abrtd ****
abrtd is stopped
**** abrt-oops ****
abrt-dump-oops is stopped
**** acpid ****
acpid (pid  1501) is running...
**** amtu ****
**** arptables_jf ****
**** arpwatch ****
arpwatch is stopped
**** atd ****
atd is stopped
**** auditd ****
auditd (pid  1359) is running...
**** autofs ****
automount is stopped
**** avahi-daemon ****
avahi-daemon is stopped
**** bacula-fd ****
bacula-fd is stopped
**** bgpd ****
bgpd is stopped
**** blk-availability ****
**** bluetooth ****
Usage: /etc/init.d/bluetooth {start|stop}
**** bmc-watchdog ****
bmc-watchdog is stopped
**** cachefilesd ****
cachefilesd is stopped
**** capi ****
capi is stopped
**** certmonger ****
certmonger is stopped
**** cgconfig ****
Stopped
**** cgdcbxd ****
cgdcbxd is stopped
**** cgred ****
cgred is stopped
**** clvmd ****
clvmd is stopped
**** cman ****
corosync is stopped
**** cmirrord ****
cmirrord is stopped
**** conman ****
conmand is stopped
**** corosync ****
corosync is stopped
**** corosync-notifyd ****
corosync-notifyd is stopped
**** cpglockd ****
cpglockd is stopped
**** cpuspeed ****
p4-clockmod passive cooling is enabled
**** crond ****
crond (pid  1582) is running...
**** ctdb ****
Checking for ctdbd service:   ctdbd not running. ctdb is stopped
**** cups ****
cupsd is stopped
**** cyrus-imapd ****
cyrus-imapd is stopped
**** dhcpd ****
dhcpd is stopped
**** dhcpd6 ****
dhcpd is stopped
**** dhcrelay ****
dhcrelay is stopped
**** dirsrv ****
  *** Error: no dirsrv instances configured
**** dirsrv-snmp ****
dirsrv-snmp is stopped
**** dnsmasq ****
dnsmasq is stopped
**** dovecot ****
dovecot is stopped
**** ebtables ****
# Generated by ebtables-save v1.0 on Tue Mar 12 10:18:58 EDT 2013
**** edac ****
**** fcoe ****
/usr/sbin/fcoemon -- UNUSED
No interfaces created.
**** fcoe-target ****
Use targetcli to check status.
**** fence_virtd ****
fence_virtd is stopped
**** firstboot ****
service firstboot supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add firstboot')
firstboot is not scheduled to run
**** foghorn ****
foghorn is stopped
**** functions ****
env: /etc/init.d/functions: Operace zamítnuta
**** gatherer ****
gatherd is stopped
reposd is stopped
**** gfs2 ****
GFS2: no entries found in /etc/fstab
**** gpm ****
gpm is stopped
**** haldaemon ****
hald is stopped
**** halt ****
Usage: /etc/init.d/halt {start}
**** haproxy ****
haproxy is stopped
**** hsqldb ****
I don't know of any running hsqldb server.
**** htcacheclean ****
htcacheclean is stopped
**** httpd ****
httpd is stopped
**** hypervkvpd ****
hv_kvp_daemon is stopped
**** ibacm ****
**** ipa ****
IPA is not configured (see man pages of ipa-server-install for help)
**** ipa_memcached ****
ipa_memcached is stopped
**** ipmi ****
ipmi_msghandler module in kernel.
ipmi_si module in kernel.
ipmi_devintf module not loaded.
/dev/ipmi0 does not exist.
**** ipmidetectd ****
ipmidetectd is stopped
**** ipmievd ****
ipmievd is stopped
**** ipsec ****
IPsec stopped
**** iptables ****
iptables: Firewall is not running.
**** ipvsadm ****
ipvsadm: IPVS is not running.
**** ip6tables ****
ip6tables: Firewall is not running.
**** irqbalance ****
irqbalance (pid 1408) is running...
**** iscsi ****
iscsi is stopped
**** iscsid ****
iscsid is stopped
**** isdn ****
/etc/init.d/isdn: Link is down
**** isnsd ****
isnsd is stopped
**** kadmin ****
kadmind is stopped
**** kdump ****
Kdump is not operational
**** keepalived ****
keepalived is stopped
**** killall ****
Usage: /etc/init.d/killall {start}
**** kprop ****
kpropd is stopped
**** krb5kdc ****
krb5kdc is stopped
**** ksm ****
ksm is not running
**** ksmtuned ****
ksmtuned is stopped
**** ktune ****
ktune settings are not applied.
**** libvirtd ****
libvirtd is stopped
**** libvirt-guests ****
stopped, with no saved guests
**** lldpad ****
lldpad is stopped
**** lm_sensors ****
i5k_amb-isa-0000
Adapter: ISA adapter
Ch. 0 DIMM 0: +45.0°C  (low  = +127.5°C, high = +127.5°C)  
Ch. 0 DIMM 1: +31.0°C  (low  = +127.5°C, high = +127.5°C)  
Ch. 1 DIMM 0: +38.0°C  (low  = +127.5°C, high = +127.5°C)  
Ch. 1 DIMM 1: +37.0°C  (low  = +127.5°C, high = +127.5°C)  

**** luci ****
No PID file /var/run/luci/luci.pid
**** lvm2-lvmetad ****
lvmetad is stopped
**** lvm2-monitor ****
**** mailman ****
mailman is stopped
**** mcelogd ****
Checking for mcelog
mcelog is stopped
**** mcstrans ****
mcstransd is stopped
**** mdmonitor ****
mdmonitor is stopped
**** memcached ****
memcached is stopped
**** messagebus ****
messagebus (pid  1455) is running...
**** mip6d ****
mip6d is stopped
**** modclusterd ****
modclusterd is stopped
**** multipathd ****
multipathd is stopped
**** mysqld ****
mysqld is stopped
**** named ****
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
named is stopped
**** netcf-transaction ****
No open transaction
**** netconsole ****
netconsole module not loaded
**** netfs ****
Configured NFS mountpoints: 
/mnt/redhat
/mnt/engarchive2
/mnt/engarchive
/mnt/qa
Active NFS mountpoints: 
/mnt/redhat
/mnt/engarchive2
/mnt/engarchive
/mnt/qa
**** netlabel ****
Netlabel is stopped.
**** network ****
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0
**** NetworkManager ****
NetworkManager is stopped
**** nfs ****
rpc.svcgssd is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
**** nfslock ****
rpc.statd (pid  1440) is running...
**** nfs-rdma ****
grep: /proc/fs/nfsd/portlist: No such file or directory
**** nmb ****
nmbd is stopped
**** nscd ****
nscd is stopped
**** nslcd ****
nslcd is stopped
**** ntpd ****
ntpd (pid  1548) is running...
**** ntpdate ****
**** numad ****
numad is stopped
**** oatsd ****
oatsd is stopped

Starting applications specified in /home/rescuer/.vnc/xstartup
Log file is /home/rescuer/.vnc/x86-64-6s-m1.ss.eng.bos.redhat.com:10.log

oats-config-system: rebooting at Thu Mar 7 15:28:50 EST 2013
oatsd: System is already configured, exiting.
**** oddjobd ****
oddjobd is stopped
**** openct ****
ifdhandler is stopped
**** openhpid ****
openhpid is stopped
**** openhpi-subagent ****
hpiSubagent is stopped
**** opensm ****
opensm is stopped
**** openwsmand ****
Checking for service Openwsman Daemon             stopped
             stopped
**** oscap-scan ****
**** ospfd ****
ospfd is stopped
**** ospf6d ****
ospf6d is stopped
**** pacemaker ****
pacemakerd is stopped
**** pcscd ****
pcscd is stopped
**** phc2sys ****
phc2sys is stopped
**** piranha-gui ****
httpd is stopped
**** pkcsslotd ****
pkcsslotd is stopped
**** pki-cad ****
This machine contains no registered 'pki-ca' subsystem instances!
**** portreserve ****
portreserve is stopped
**** postfix ****
master is stopped
**** postgresql ****
postmaster is stopped
**** pppoe-server ****
pppoe-server is stopped
**** psacct ****
Process accounting is disabled.
**** ptp4l ****
ptp4l is stopped
**** pulse ****
pulse is stopped
**** qemu-ga ****
qemu-ga is stopped
**** qpidd ****
qpidd is stopped
**** quota_nld ****
quota_nld is stopped
**** radiusd ****
radiusd is stopped
**** radvd ****
radvd is stopped
**** rdisc ****
rdisc is stopped
**** rdma ****
Low level hardware support loaded:
        none found

Upper layer protocol modules:
        none found

User space access modules:
        none found

Connection management modules:
        none found

**** restorecond ****
restorecond is stopped
**** rgmanager ****
rgmanager is stopped
**** rhnsd ****
rhnsd (pid  1592) is running...
**** rhsmcertd ****
rhsmcertd is stopped
**** ricci ****
ricci is stopped
**** ripd ****
ripd is stopped
**** ripngd ****
ripngd is stopped
**** rngd ****
rngd is stopped
**** rpcbind ****
rpcbind (pid  1422) is running...
**** rpcgssd ****
rpc.gssd is stopped
**** rpcidmapd ****
rpc.idmapd is stopped
**** rpcsvcgssd ****
rpc.svcgssd is stopped
**** rstatd ****
rpc.rstatd is stopped
**** rsyslog ****
rsyslogd (pid  1377) is running...
**** rusersd ****
rpc.rusersd is stopped
**** rwhod ****
rwhod is stopped
**** sandbox ****
sandbox is stopped
**** saslauthd ****
saslauthd is stopped
**** sblim-sfcb ****
sfcb is not running
**** sendmail ****
sendmail (pid  1564) is running...
sm-client (pid  1573) is running...
**** single ****
**** slapd ****
slapd is stopped
**** smartd ****
smartd is stopped
**** smb ****
smbd is stopped
**** snmpd ****
snmpd is stopped
**** snmptrapd ****
snmptrapd is stopped
**** spamassassin ****
spamd is stopped
**** spice-vdagentd ****
spice-vdagentd is stopped
**** squid ****
squid is stopped
**** srpd ****
**** sshd ****
openssh-daemon (pid  1518) is running...
**** sssd ****
sssd is stopped
**** stap-server ****
No managed stap-server is running
**** stinit ****
**** svnserve ****
svnserve is stopped
**** sysstat ****
**** systemtap ****
No systemtap scripts are present
**** tcsd ****
tcsd is stopped
**** tgtd ****
tgtd is stopped
**** tog-pegasus ****
CIM server is not running
**** tomcat6 ****
tomcat6 is stopped                                         [  OK  ]
**** tpsd ****
Recent tpsd activity:
tpsd: testing errata: 2013:14551 jobID 158035 runID 17524 at Tue Mar 12 08:14:48 EDT 2013
tpsd: completed 2013:14551 status BAD jobfile 1363090472 at Tue Mar 12 08:18:20 EDT 2013
 
tpsd: testing errata: 2013:14551 jobID 158035 runID 17524 at Tue Mar 12 09:29:09 EDT 2013
tpsd: completed 2013:14551 status BAD jobfile 1363094910 at Tue Mar 12 09:32:46 EDT 2013
 

tpsd (pid 1671) is running...
**** trace-cmd ****
trace-cmd is stopped
**** tuned ****
tuned is stopped
**** udev-post ****
**** uuidd ****
uuidd is stopped
**** virt-who ****
virt-who is stopped
**** vncserver ****
Xvnc (pid 1640) is running...
**** vsftpd ****
vsftpd is stopped
**** watchdog ****
watchdog is stopped
**** wdaemon ****
wdaemon is stopped
**** winbind ****
winbindd is stopped
**** wpa_supplicant ****
wpa_supplicant is stopped
**** xinetd ****
xinetd (pid  1526) is running...
**** ypbind ****
ypbind is stopped
**** yppasswdd ****
rpc.yppasswdd is stopped
**** ypserv ****
ypserv is stopped
**** ypxfrd ****
rpc.ypxfrd is stopped
**** zebra ****
zebra is stopped

Comment 9 Lukáš Nykrýn 2013-03-13 15:37:09 UTC
I have discussed this with Bill Nottingham and he also agrees that previous behavior was in some cases inconsistent and it makes sense to learn people to use interface (we should create some article about this in documentation). Also this type of output should not be considered as ABI supported between major releases.

So closing this as notabug a please don't reopen it again.


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