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

Available, disabled services in list #52

Open
jackghg opened this issue Mar 26, 2022 · 14 comments
Open

Available, disabled services in list #52

jackghg opened this issue Mar 26, 2022 · 14 comments
Labels
A-Importance: Normal C-dinitctl Things about dinitctl Feature Request Request a feature to be added to dinit

Comments

@jackghg
Copy link

jackghg commented Mar 26, 2022

The list command should show also the installed but not enabled, never started services.
And maybe list by status ?

@davmac314
Copy link
Owner

The list command should show also the installed but not enabled, never started services.

This would require dinit (or at least dinitctl) to be able to determine which services have been installed (but not yet loaded). One option would be to assume that every file in the services directory is in fact a service description file, but that seems liable to cause issues; or, attempt to parse every such file as a service description in order to weed out non-service-description files, but that seems like an ugly solution and doesn't completely solve possible issues anyway; or, to have a separate file listing all installed services, which is less prone to accidental confusion between service and non-service but which requires this file to be updated appropriate when services are installed or uninstalled. This latter would be my preferred approach, and patches implementing this are welcome.

And maybe list by status ?

Sure, patches welcome for this too.

@jackghg
Copy link
Author

jackghg commented Mar 26, 2022

Thanks, on a second thought, im not sure if this is the wanted behavior when someone do list... Maybe an option to include them like systemd --all. Or another app is also a good idea. Check if the services are valid is also usefull... even if to do that you just have to try to start it... well an app can check multiple...

I think that the problem to fix here is, "whats the name of the service of the package i installed ?"

@jackghg
Copy link
Author

jackghg commented Mar 28, 2022

It could be just an app that lists the files in the 2 or 3 folders where dinit looks for services. Or it could be a kind of a diagniostic tool. Or do nothing is also an option...

@davmac314
Copy link
Owner

Have thought about it a bit more. I think it makes sense to add an --all option to dinitctl list that causes it to display all non-executable files in the description directories as potential services (probably with some name-based filtering, eg excluding files beginning with dot). It is a better experience for the users if they have this option and it's unlikely that other files should end up in the service directories anyway.

@jackghg
Copy link
Author

jackghg commented Mar 31, 2022

good!

@jackghg
Copy link
Author

jackghg commented Apr 20, 2022

A step back, how to list the running services ?
On my artix it shows all the services that has ever started (around 40) and all with the same status, started, must be something broke.

@davmac314
Copy link
Owner

dinitctl list shows all loaded services regardless of their state. The leading glyphs indicate service state, eg [ {-}] samba-smbd means that samba-smbd is a stopped service, check man dinitctl for more information. There is no way currently to restrict the list to only running services.

You can also use dinitctl status <servicename> to check the state of a single service though that is not completely reliable with the last release due to a bug (it may give an error message, which means nothing about the state of the service; since been fixed in development).

With all above in mind, if dinitctl list is showing all services as started even though some are definitely not currently running, that would be a bug. However, it works fine for me. Try stopping a specific service and re-check status just to be sure.

@jackghg
Copy link
Author

jackghg commented Apr 20, 2022

that was fast! It shows [{+} ] for all the 49 services.
The status of a ghost service gives an error, after I stop the service (both running and non running) list shows the correct stopped status.

Some service has pid:xxx but not all of the really running services.

@jackghg
Copy link
Author

jackghg commented Apr 20, 2022

what services should be shown ? I think, the running services, the enabled services, the manually started and stopped services ? idk , the manually started one-shot services ? idk.

Maybe the "system services" could be hidden, and shown only if the future "--all" option is set ?
By system services i mean the services that are built-in dinit and mandatory.

@davmac314
Copy link
Owner

that was fast! It shows [{+} ] for all the 49 services.
The status of a ghost service gives an error, after I stop the service (both running and non running) list shows the correct stopped status.

Ok so it sounds like all services are running and correctly showing as running.

Some service has pid:xxx but not all of the really running services.

Only process and bgprocess services can have a pid associated.

Maybe the "system services" could be hidden, and shown only if the future "--all" option is set ?
By system services i mean the services that are built-in dinit and mandatory.

There aren't any services built-in to dinit. The only (somewhat) mandatory service is "boot". The services you are seeing are what the distribution provides

@jackghg
Copy link
Author

jackghg commented Apr 21, 2022

There aren't any services built-in to dinit. The only (somewhat) mandatory service is "boot".

Some example: loginready, setup, cleanup, pseudofs, sysusers, vconsole, mount, hostname, misc, modules...
I dont think that one wants to see these when run list... maybe im wrong... How can I call these services ? internal ? os init services ?

@davmac314
Copy link
Owner

Dinit doesn't make any distinction between these services and other services. I think such functionality would have to be part of an external tool. I guess I consider this out-of-scope for DInit itself.

@mobin-2008 mobin-2008 added A-Importance: Normal C-dinitctl Things about dinitctl Feature Request Request a feature to be added to dinit labels Aug 6, 2022
@kopavel
Copy link

kopavel commented Jan 28, 2023

If service don't have any PID-file or ServiceStop command - we can interpret that service as "one time command" (or have a specific "not script" type for that) and those service are immediately "stopped" after command end.

@jackffmm
Copy link

jackffmm commented Jun 6, 2023

I'm the OP, this is my new account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Importance: Normal C-dinitctl Things about dinitctl Feature Request Request a feature to be added to dinit
Projects
None yet
Development

No branches or pull requests

5 participants