Skip to content

Problem with getting service names #46

@copystring

Description

@copystring

Describe the bug
You're using systemctl list-units --type service --all --no-legend | awk '{out=""; for(i=5;i<=NF;i++){out=out" "$i}; print $1","$2","$3","$4","out}' to list all services. On my system some services have an asterisk before the actual service name.

See this truncated list:
systemctl list-units --type service --all --no-legend | awk '{out=""; for(i=5;i<=NF;i++){out=out" "$i}; print $1","$2","$3","$4","out}' apparmor.service,loaded,active,exited, Load AppArmor profiles apt-daily-upgrade.service,loaded,inactive,dead, Daily apt upgrade and clean activities apt-daily.service,loaded,inactive,dead, Daily apt download activities *,auditd.service,not-found,inactive, dead auditd.service *,connman.service,not-found,inactive, dead connman.service

Resulting in errors like this: State "linux-control.1.storj.services.*.running" has no existing object, this might lead to an error in future versions

These services either need to be ignored or start to get the service name after the asterisk otherwise the services list is never fully completed. See this:

image

Versions:

  • Adapter version: 1.16
  • JS-Controller version: 4.0.23
  • Node version: v16.17.1
  • Operating system: debian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions