-
-
Notifications
You must be signed in to change notification settings - Fork 67
tmpfiles: refactor into separate executable #439
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
troglobit
left a comment
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.
Looks good so far, nice work! 👍
Please elaborate a little more on command line options though. You mention --create, which I was sort of expecting in the call in bootmisc.c. A basic usage text would be sufficient.
ef667b7 to
cdff3e4
Compare
hopefully this is in the right direction... looking forward to feedback thanks |
You're right, I have a lot of opinions about that commit 😄 I'll try to be harsh but fair:
In summary, please explain to me why Also, your commit messages need to tell the story of Why a change is made, reasoning with a future reader, explaining the intent.
OK, nice find.
For future reference, and as a matter of process, please keep PRs as draft until you've verified your changes.
Definitely in the right direction, great work so far! |
this was not my original intention - i also wanted to link existing
thanks for the feedback - more to come |
|
@troglobit i loaded this branch of
when you get a chance please let me know how this looks... thank you! |
Awesome, I'll have a look over the weekend, cheers! |
troglobit
left a comment
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.
Looks much better, nice work!
You can squash the first two commits, but the last one needs to be split up so you do any refactoring/reshuffle of code in a separate commit from where you add --create and --remove flags. Also, the first line of that commit wraps, try to keep a brief first line of the commit, e.g., "tmpfiles: add --create and --remove flags" is sufficient, the rest of the text can go in the body.
The tmpfiles.d spec has proven useful in systemd, enough so that some developers are starting to ship tmpfiles.d configuration files with their software. By splitting the tmpfiles functionality in finit out into a separate executable we are providing a useful piece of software that package managers can hook into.
The tmpfiles.d spec contains entry types that should be acted upon in different modes of operation: create, clean, remove, and purge - split up create & remove logic to clarify the modes of operation finit supports.
Allow execution of tmpfiles to specify which mode(s) of operation to run in.
> D > Similar to d, but in addition the contents of the directory will be removed when --remove is used.
|
@troglobit i think the second commit accomplishes what you want to see here don't hesitate to let me know if there are any changes i can make so you're completely happy with this PR... your code quality is great, so i really don't mind nitpicks from you 🙇♂️ |
troglobit
left a comment
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 looks much better, very nice!
My comments on memory usage could be considered theoretical, but I've learned that it's always best to keep it clean because you never know how code transforms or where it is used. An esoteric use-case is running Finit on uClinux systems (CPUs without MMU), there Linux would not clean up and free memory a process has not freed itself.
The existing implementation seemed useful enough to warrant a new helper function. Care was taken to ensure the revised code no longer suffers any memory leaks.
|
🥇 Great work on this, time to squash some of the commits and mark this as Ready for review 🏁 |
|
awesome! thanks for all your time and patience on this! previously you mentioned that you like commits to be well defined logically small changes, which sounds good - i feel that's what we have here... so please let me know explicitly what you want and i am happy to comply |
No problem at all!
Yeah, so logical commits are just that: "whitespace changes only", "drop foo functionality, not used anymore", "add bar to baz, extending xyzzy", just cleanly separating what removes, relocates, and what adds new functionality. Think; "what if I had to debug these changes myself", what would you like to see. Also, there's the art of bisectability, i.e., each change builds and is testable on its own. This latter one I struggle with myself. The most important thing, apart from commit messages telling why a change is made, is to keep changes logical. So, when you look at a series of patches/commits you should be able to, at some degree, trust the submitter. So when they say, "whitespace changes only", you can skip that commit at the beginning and focus on removals and additions. It's all about making it easier for the reviewer, and yourself a few weeks/months/years down the line ... |
|
i have been running this for a bit on my system and i think it is ready for a final review |
troglobit
left a comment
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 looks great, and the tests pass, so time to merge!
Awesome job on this, @aanderse ! 💯 🥇
|
thanks again! |
this PR is an attempt to resolve #423
i thought i would open this PR early for more concrete discussion and feedback - i don't want to end up too far down a path which you aren't interested in merging
i am proposing the following for this PR:
libexec/--createand--removeargs to the program so we can run only the desired behaviour (randRrules will execute when--removeis passed to the program, the rest when--createis)this sets us up for future PR(s) where more useful functionality can be fleshed out, including the
--cleanflag for time based cleanupOriginally posted by @troglobit in #423
regarding
tmpfilesas a service... i'm not sure how useful that actually is - the main reason new tmpfile configs are added to the system is part of package/system management hooks - but of course there is still the cleanup aspect... given that there is no cleanup currently implemented, i don't think that is a strong argument for a servicewhat do you think? am i heading in a direction you would be willing to merge? thanks again for your time and consideration 🙇♂️