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

rc-status: Remove unnecessary checks in print_services(). #754

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

navi-desu
Copy link
Member

Every caller of the function already gets a list of services from a valid librc api, and does filtering themselves.

The rc_service_in_runlevel specially is quite clear to me that it doesn't really matter.

The deptree check seems useless, it just checks if it's on the deptree and filters the service if not, but callers already get those service lists from proper functions. If anyone sees the use for the deptree check, do tell

@navi-desu
Copy link
Member Author

okay i found one issue with this patch, stacked runlevels are shown when they shouldn't

although i think i can fix it without all that complexity

@navi-desu navi-desu marked this pull request as draft September 25, 2024 00:03
@navi-desu navi-desu self-assigned this Sep 25, 2024
@navi-desu navi-desu marked this pull request as ready for review September 25, 2024 00:24
@navi-desu
Copy link
Member Author

ls_dir is erroneusly including directories when LS_INITD is set, which makes rc_services_in_runlevel return stacked runlevels as well. this bug was hidden in rc-status due to the unnecessary double check on every printed service.

Every caller of the function already gets a list of services from a
valid librc api, and does filtering themselves.
ls_dir is used to list services in a runlevel, in which directories are
stacked runlevels, not init scripts. And in general, folders are not
allowed in init.d dirs anyway.
@navi-desu navi-desu marked this pull request as draft September 26, 2024 16:12
@navi-desu navi-desu marked this pull request as ready for review September 27, 2024 08:15
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

Successfully merging this pull request may close these issues.

1 participant