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

Find init in PATH when use Linux #647

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

RMTT
Copy link

@RMTT RMTT commented Dec 6, 2023

Describe your changes

Find init from system PATH instead of hardcode the /sbin/init in GetInitType when use Linux.

Some Linux distros have no /sbin, such as NixOS , but the init can be found in PATH in most cases.
But If there is no init in PATH, user just need change PATH before start netclient.

Checklist before requesting a review

  • My changes affect only 10 files or less.
  • I have performed a self-review of my code and tested it.
  • If it is a new feature, I have added thorough tests, my code is <= 1450 lines.
  • If it is a bugfix, my code is <= 200 lines.
  • My functions are <= 80 lines.
  • I have had my code reviewed by a peer.
  • My unit tests pass locally.
  • Netclient & Netmaker are awesome.

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2023

CLA assistant check
All committers have signed the CLA.

@yabinma
Copy link
Collaborator

yabinma commented May 8, 2024

@RMTT , Thank you for opening the PR. It's good for checking init on system without /sbin folder.

/sbin is not the only place used in the code logic. netclient executable file is also installed under /sbin. I am not sure if you are interested in making the change for installation directory. Otherwise the install will be still failed even the init check passed.

@RMTT
Copy link
Author

RMTT commented May 10, 2024

@RMTT , Thank you for opening the PR. It's good for checking init on system without /sbin folder.

/sbin is not the only place used in the code logic. netclient executable file is also installed under /sbin. I am not sure if you are interested in making the change for installation directory. Otherwise the install will be still failed even the init check passed.

Sorry, i don't understand your proposal. This pr only modified the logic to find init, it doesn't affect the installation behavior of netclient.

@yabinma
Copy link
Collaborator

yabinma commented May 14, 2024

@RMTT , Thank you for opening the PR. It's good for checking init on system without /sbin folder.
/sbin is not the only place used in the code logic. netclient executable file is also installed under /sbin. I am not sure if you are interested in making the change for installation directory. Otherwise the install will be still failed even the init check passed.

Sorry, i don't understand your proposal. This pr only modified the logic to find init, it doesn't affect the installation behavior of netclient.

As the issue description, Some Linux distros have no /sbin, such as NixOS . Current code logic, it does not work only when there is no /sbin. So the PR,

  1. No impact to Linux distros with /sbin
  2. It is helpful when Linux distrios without /sbin. But netclient does not work even with this PR. if searching with /sbin, it's used in other place besides GetInitType

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.

5 participants