Closed jabedude closed 4 years ago
Hey! Appreciate the interest! I would of course be willing to upstream this. A few things I'd like changed beforehand though:
environment: Option<EnvVars>
in Service seems unused right? This should reside only in the ServiceConfig.fork_child::after_fork_child
some other env vars are set, you can try to mimic that behaviour.fork_child::after_fork_child
just to keep the match case small.I am currently rethinking how services should be started in general, see issue #42. That would remove all the weird hacking around restrictions on what can be safely done between fork and exec. But it has it's own problems. I am not sure how to solve this problem in a good manner, but for now what rustysd does currently seems to work fine.
Can I ask how good/bad your experience was, adding functionality to rustysd, like was a pain to find stuff, or was something annoying in the structure? This is my first bigger project so I am curious :)
Awesome, good to hear!
The environment: Option
in Service seems unused right? This should reside only in the ServiceConfig.
Yes definitely. I'll fix that.
fork_child::after_fork_child some other env vars are set, you can try to mimic that behaviour.
Sounds good! I'll push an update now.
I think it was a good experience overall! I think some parts could be refactored a bit to be more idiomatic, but that's the beauty of open source :) We can improve it together!
Hey, that looks good!
One last thing, the Environment=
setting is part of systemd.exec which is
parse_exec_section
in unit_parser.rsExecConfig
struct together with the other settings from that sectionI am sorry that I did not catch that yesterday. If you could make that change I think it is ready to get merged :)
No problem. Let me know if this looks okay to you :smile:
Yep, looks good. Thank you! :)
Hello! While playing around with
rustysd
(awesome project :) ), I was tinkering with adding a simple-ish service configuration option and added support forEnvironment=
. Would you be open to upstreaming this?