-
Notifications
You must be signed in to change notification settings - Fork 2.2k
make systemd and its dependencies optional via 'no_systemd' build tag #2987
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
// SystemdProps are any additional properties for systemd, | ||
// derived from org.systemd.property.xxx annotations. | ||
// Ignored unless systemd is used for managing cgroups. | ||
SystemdProps []systemdDbus.Property `json:"-"` |
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.
Instead of duplicating the whole structure, you need to embed a sub-structure which can be defined to be empty in case no_systemd
build tag is set.
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.
fixed that in recent push
@AkihiroSuda @kolyshkin Does cgroupv2 still require systemd, or is systemd support only required if you're using cgroupv2 on a systemd system? (From memory the early design required it, but I haven't closely followed how it's evolved since. Since we have @metux This needs new CI jobs to make sure that |
Never required on non-systemd hosts. Even on systemd hosts, the systemd driver was never strictly required in practice, but future version of systemd may strictly require it, in theory. |
Yes, and README (the build tags section) needs to be updated too. |
"Required" may have been too strong of a word to use. Though you can't set |
I think we can implement "minimal" systemd support, adding something like if IsRunningSystemd() {
err := os.Exec("systemctl", "set-property", unit, "Delegate=yes").Run()
...
} This code won't add any new dependencies or impact the binary size much. In fact, ideally this should be done with Thinking about this, an "alternative" systemd driver can be added to runc, which will call |
eb4038a
to
699e479
Compare
Where does IsRunningSystemd() come from when speaking to systemd and thats dependencies are off ? OTOH, I feel very unhappy with such arbitrary command calls, especially in case when systemd stuff had been disabled explicitly. Could end up calling a completely different program. Actually, I once used to write one with that name, long before systemd even existed. |
956794d
to
19758b8
Compare
I think we should have it in 1.1. Set the milestone accordingly. |
Running under systemd requires lots of special code that contributes to ca. 10 percent (ca. 1 MB) to the binary size. This is only needed on targets that might run systemd - there're dozens of distros, let alone embedded/edge devices or special images (eg. cluster worker nodes) that do not and never will run systemd, thus do not need that code at all. It's not just about reducing memory consumption, but also having over 10.000 lines of code less to audit. In order not to change default behaviour, introducing an inverse build tag, 'no_systemd', for explicitly opting out from systemd special handlings. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The idea is to make it possible to use The But I don't think that calling So we can just assume that system won't screw up whatever we create in |
Can we somehow limit the number of jobs? 60 is too much :) Say, only test with non-default tags on 1 go version. Or something similar. |
@metux can you please address #2987 (comment), and also do a rebase? |
@metux please let us know if you want to keep working on this. This needs a rebase, and #2987 (comment) also needs to be addressed. |
obsoleted by rewrite: #3959 |
Running under systemd requires lots of special code that contributes
to ca. 10 percent (ca. 1 MB) to the binary size. This is only needed on
targets that might run systemd - there're dozens of distros, let alone
embedded/edge devices or special images (eg. cluster worker nodes) that
do not and never will run systemd, thus do not need that code at all.
It's not just about reducing memory consumption, but also having over
10.000 lines of code less to audit.
In order not to change default behaviour, introducing an inverse build tag,
'no_systemd', for explicitly opting out from systemd special handlings.
Signed-off-by: Enrico Weigelt, metux IT consult info@metux.net