Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Better katello-service list output #238

Open
@ericzolf

Description

@ericzolf

The current output of the 'list' command just tells if the unit exists and is enabled, it doesn't tell if the service is running or not (whereas the output of 'status' is unreadable).

I suggest the following slight change to the list_services function:

    regex = services_by_priority.map { |service| "^[^a-z_-]*#{service}.service" }.join('\|')
    puts `systemctl list-units --all \*.service | grep -e '#{regex}' -e '^ *UNIT'`

The output then looks as follows (with systemctl), which is much more informative while remaining readable:

# katello-service list
  UNIT                                   LOAD      ACTIVE   SUB     DESCRIPTION
  foreman-proxy.service                  loaded    inactive dead    Foreman Proxy
  foreman-tasks.service                  loaded    inactive dead    Foreman jobs daemon
  httpd.service                          loaded    active   running The Apache HTTP Server
  mongod.service                         loaded    active   running High-performance, schema-free document-oriented database
  postgresql.service                     loaded    active   running PostgreSQL database server
  pulp_celerybeat.service                loaded    active   running Pulp's Celerybeat
  pulp_resource_manager.service          loaded    active   running Pulp Resource Manager
  pulp_workers.service                   loaded    active   exited  Pulp Celery Workers
  qdrouterd.service                      loaded    active   running Qpid Dispatch router daemon
  qpidd.service                          loaded    active   running An AMQP message broker daemon.
  tomcat.service                         loaded    active   running Apache Tomcat Web Application Container

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions