feat(sys/kernel): add hostname and domainname#363
Open
tastypackets wants to merge 2 commits intoeminence:masterfrom
Open
feat(sys/kernel): add hostname and domainname#363tastypackets wants to merge 2 commits intoeminence:masterfrom
tastypackets wants to merge 2 commits intoeminence:masterfrom
Conversation
tastypackets
commented
Dec 30, 2025
f35035e to
f233ee7
Compare
Author
|
@eminence Hey would it be possible to get a review on this PR? I was needing hostname and domain for a project I'm working on. |
Owner
|
Sure thing, I'll try to take a look this weekend |
eminence
requested changes
Jan 4, 2026
Owner
eminence
left a comment
There was a problem hiding this comment.
In general looks fine, but two small comments:
- Do we really need these two examples? They're not really doing much.
- Can you add a
cfgcheck in the new tests so that they won't set a hostname unless some feature flag is enabled? In general I don't want changes to be made to the running system (and these tests probably require root to run successfully?)
eminence
reviewed
Jan 4, 2026
procfs/src/sys/kernel/mod.rs
Outdated
Comment on lines
619
to
621
| let test_domain = String::from("test-host"); | ||
|
|
||
| let test_domain = "test.local".to_string(); |
Owner
There was a problem hiding this comment.
One of these variables is not needed
Author
There was a problem hiding this comment.
Nice catch think I copy pasted something and wasn't paying attention. 😓
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
sys/kernel/hostnameandsys/kernel/domainnamesupport.Added a new line check on hostname & domainname which are used as a terminator like sysctl. Without the new line terminator trying to clear the values does not work. For example writing
""to domainname is ignored, but writing"\n"does clear the domainname.Related docs: https://man7.org/linux/man-pages/man5/proc_sys_kernel.5.html