Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with getting service names #46

Open
copystring opened this issue Oct 7, 2022 · 4 comments
Open

Problem with getting service names #46

copystring opened this issue Oct 7, 2022 · 4 comments

Comments

@copystring
Copy link

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
@copystring
Copy link
Author

copystring commented Oct 7, 2022

Or maybe it is useful to use list-unit-files --state=enabled instead of list-units --type service --all?
The services which are disabled have the asterisk in front.

@Scrounger
Copy link
Owner

which distibution is that?

@copystring
Copy link
Author

debian 11 running in a proxmox lxc with nested enabled. With nested it shows the services of the host in addition to it's own services.

copystring added a commit to copystring/ioBroker.linux-control that referenced this issue Sep 30, 2023
copystring added a commit to copystring/ioBroker.linux-control that referenced this issue Sep 30, 2023
@copystring
Copy link
Author

Please accept this PR to fix the issue. #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants