Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 573134

Summary: sys-apps/openrc: rc-status should sort init scripts
Product: Gentoo Hosted Projects Reporter: Patrick Lauer <patrick>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Patrick Lauer gentoo-dev 2016-01-27 15:16:41 UTC
The output of rc-status is very random, which makes it hard to see at one glance if a specific init script is started. Alphabetically sorting the output for each runlevel might make it more human-readable.

# rc-status
Runlevel: default hostname                                                                                                                                                                                                                                                         [  started  ]
 syslog-ng                                                                                                                                                                                                                                                        [  started  ]
 haveged                                                                                                                                                                                                                                                          [  started  ]
 iptables                                                                                                                                                                                                                                                         [  started  ]
 net.eno1                                                                                                                                                                                                                                                         [  started  ]
 net.eno2                                                                                                                                                                                                                                                         [  started  ]
 dnsmasq                                                                                                                                                                                                                                                          [  started  ]
 postfix                                                                                                                                                                                                                                                          [  started  ]
 vixie-cron                                                                                                                                                                                                                                                       [  started  ]
 microcode_ctl                                                                                                                                                                                                                                                    [  started  ]
 atd                                                                                                                                                                                                                                                              [  started  ]
 sshd                                                                                                                                                                                                                                                             [  started  ]
 netmount                                                                                                                                                                                                                                                         [  started  ]
 ntpd                                                                                                                                                                                                                                                             [  started  ]
 local                                                                                                                                                                                                                                                            [  started  ]
Comment 1 William Hubbs gentoo-dev 2016-01-27 22:01:14 UTC
rc-status displays the services in the order they would start, so it
isn't actually random.

The preferred way to get the status of a single service, if that
is what you are looking for, is

rc-service <svcname> status

Also, you can do something like this if you want to look it up with
rc-status

rc-status | grep <svcname>

Given that, I'm not sure whether it is worth the effort to sort the
output from rc-status.
Comment 2 William Hubbs gentoo-dev 2016-01-27 22:12:09 UTC
I will take a look and see if there is a way to sort them and make it an
option, but I don't want to change the default display order.
Comment 3 William Hubbs gentoo-dev 2016-02-01 23:37:20 UTC
First off, wontfix isn't really the most accurate resolution for this,
but it is the only one that makes sense.

I spent a good part of today looking at this code and running some
tests, and it appears that this will be an extensive rewrite of
rc-status for a very small, cosmetic gain, and I'm not really interested
in putting that much effort into it.

On the other hand, if you want to provide a patch or open a pull request
for this on github, I could probably be convinced to take it as long as
it doesn't break current behaviour.