-
-
Notifications
You must be signed in to change notification settings - Fork 581
Initsystem (Linux): Detect version of shepherd. #1932
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
Conversation
// The first line in the output might not contain the version | ||
if (!ffStrbufStartsWithS(&result->version, "shepherd")) | ||
ffStrbufSubstrAfterFirstC(&result->version, '\n'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skips over the warning about missing signalfd
support on Hurd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If shepherd version always comes at the end, I prefer ffStrbufSubstrAfterLastC(&result->version, ' ');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some licensing information in the lines afterwards that I ommitted.
shepherd --version
shepherd (GNU Shepherd) 1.0.6
Copyright (C) 2025 the Shepherd authors
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
d0752b2
to
68bd10f
Compare
the loop is missing error checking when there is no |
// guile --no-auto-compile shepherd | ||
// find the shepherd script in /proc/1/cmdline | ||
const char* tmp = result->exe.chars; | ||
while(!ffStrbufEndsWithS(&result->exe, "/shepherd")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, as what I said before, you should search for /path/to/shepherd, instead of assuming it's the 2nd argument
this iterates the args until it finds the one that points to the script.
Or what else did you mean by your previous comment?
Please upload the content of |
On hurd the cmdline is the same (just with different gnu/store paths) |
Please test if 7a87638 works for you |
Thanks, it works for me. Shepherd is detected correctly as init (correct name, exe and version) on
|
Linux:
Hurd: