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
daemon: listeners: make systemd listener optional #42430
base: master
Are you sure you want to change the base?
Conversation
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.
Could you describe the problem you're trying to resolve, other than "I don't want to use systemd", as (if I'm not mistaken) this code will only be called when running as a systemd service, using the fd://
for the socket;
moby/daemon/listeners/listeners_linux.go
Lines 22 to 27 in 41be729
case "fd": | |
fds, err := listenFD(addr, tlsConfig) | |
if err != nil { | |
return nil, err | |
} | |
ls = append(ls, fds...) |
reduce unnecessary code, eg. for small systems, easier audits, ... |
a359008
to
95aa6f5
Compare
How many bytes are reduced? |
3c5cd64
to
82fdca2
Compare
82fdca2
to
9e21902
Compare
Was curious as well; did a quick try with this PR: hack/make.sh binary
ls -l --block-size=1 ./bundles/binary-daemon/
total 204955648
-rwxr-xr-x 1 root root 37224448 Aug 24 12:13 containerd
-rwxr-xr-x 1 root root 11862016 Aug 24 12:13 containerd-shim-runc-v2
-rwxr-xr-x 1 root root 18219008 Aug 24 12:13 ctr
-rwxr-xr-x 1 root root 535800 Aug 24 12:13 docker-init
-rwxr-xr-x 1 root root 2046594 Aug 24 12:13 docker-proxy
-rwxr-xr-x 1 root root 63013608 Aug 24 12:13 dockerd
-rwxr-xr-x 1 root root 14185 Aug 24 12:13 dockerd-rootless-setuptool.sh
-rwxr-xr-x 1 root root 5190 Aug 24 12:13 dockerd-rootless.sh
-rwxr-xr-x 1 root root 11002021 Aug 24 12:13 rootlesskit
-rwxr-xr-x 1 root root 7055888 Aug 24 12:13 rootlesskit-docker-proxy
-rwxr-xr-x 1 root root 14348976 Aug 24 12:13 runc
-rwxr-xr-x 1 root root 39607984 Aug 24 12:13 vpnkit
hack/make.sh dynbinary
ls -l --block-size=1 ./bundles/dynbinary-daemon/
total 71487488
-rwxr-xr-x 1 root root 2246690 Aug 24 12:12 docker-proxy
-rwxr-xr-x 1 root root 69234944 Aug 24 12:12 dockerd DOCKER_BUILDTAGS=no_systemd hack/make.sh binary
ls -l --block-size=1 ./bundles/binary-daemon/
total 204935168
-rwxr-xr-x 1 root root 37224448 Aug 24 12:14 containerd
-rwxr-xr-x 1 root root 11862016 Aug 24 12:14 containerd-shim-runc-v2
-rwxr-xr-x 1 root root 18219008 Aug 24 12:14 ctr
-rwxr-xr-x 1 root root 535800 Aug 24 12:14 docker-init
-rwxr-xr-x 1 root root 2046594 Aug 24 12:14 docker-proxy
-rwxr-xr-x 1 root root 62995856 Aug 24 12:14 dockerd
-rwxr-xr-x 1 root root 14185 Aug 24 12:14 dockerd-rootless-setuptool.sh
-rwxr-xr-x 1 root root 5190 Aug 24 12:14 dockerd-rootless.sh
-rwxr-xr-x 1 root root 11002021 Aug 24 12:14 rootlesskit
-rwxr-xr-x 1 root root 7055888 Aug 24 12:14 rootlesskit-docker-proxy
-rwxr-xr-x 1 root root 14348976 Aug 24 12:14 runc
-rwxr-xr-x 1 root root 39607984 Aug 24 12:14 vpnkit
DOCKER_BUILDTAGS=no_systemd hack/make.sh dynbinary
ls -l --block-size=1 ./bundles/dynbinary-daemon/
total 71471104
-rwxr-xr-x 1 root root 2246690 Aug 24 12:08 docker-proxy
-rwxr-xr-x 1 root root 69221448 Aug 24 12:08 dockerd Looks like it's saving 20k max (on a ~60Mib binary);
|
e3a9a5b
to
2cf0b25
Compare
On non systemd systems, the systemd-based activation is not needed at all, thus make it build-time optional. It won't be built in if the 'no_systemd' tag is set. changes v2: renamed 'nosystemd' tag to 'no_systemd' changes v3: fixed some obsolete imports use new style tags Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2cf0b25
to
dd37233
Compare
On non systemd systems, the systemd-based activation is not needed at all,
thus make it build-time optional. It won't be built in if the 'nosystemd'
tag is set.
Signed-off-by: Enrico Weigelt, metux IT consult info@metux.net
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)