Commit Graph

11 Commits

Author SHA1 Message Date
Jacob Weinstock
803747f01a Make cgroups v2 the default:
cgroups v2 has been out since 2015. Not having
to set a kernel parameter helps improve the user
experience by not requiring it when it is required
by services in a build. Making this the default was
discussed back in 2021.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
2024-04-27 15:40:00 -06:00
Avi Deitcher
0e2f17a05a correctly handle fields in cmdline for cgroupsv2
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2023-10-25 18:33:28 +03:00
David Gageot
810c3e788f
Prefer nil empty slices
Signed-off-by: David Gageot <david.gageot@docker.com>
2022-10-09 15:02:23 +02:00
David Gageot
d4e132021a
Remove 99% of deprecated ioutil usage
Signed-off-by: David Gageot <david.gageot@docker.com>
2022-10-09 13:10:38 +02:00
Dave Tucker
fcaab549fe init: Migrate to Go Modules
Moves vendoring over to Go modules.
Fixes issues found by Go Vet in Go 1.16

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-01-11 20:18:37 +00:00
Tonis Tiigi
5af7c526ec init: add support for cgroupv2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-10-24 23:03:51 -07:00
Ilya Dmitrichenko
86fb6ba0aa
pkg/init: Mount /sys/fs/bpf
NOTE: This will be a shared mount, due to root being turned into a
shared with `MC_REC` set: `mount("", "/", "", rec|shared, "")`.
For some reason setting `shared` when mounting `/sys/fs/bpf` doesn't
work at all, perhaps that's just a kernel feature.

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2020-05-06 11:06:54 +01:00
Ian Campbell
a4230b74aa init: print integer with %d not %s
go_vet (via https://goreportcard.com/report/github.com/linuxkit/linuxkit)
reported:

    error: arg resource for printf verb %s of wrong type: int (vet)

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-01-15 17:24:36 +00:00
Tobias Klauser
642c6f23ac Use pure Go unix.Reboot function in rc.init
Use unix.Reboot from golang.org/x/sys/unix for poweroff and reboot
instead of relying on external commands.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-01-04 13:16:28 +01:00
Justin Cormack
042cd763fe Add vendoring for rc.init
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-09-18 11:46:00 -07:00
Justin Cormack
bcfb760a1d Convert rc.init and rc.shutdown to Go
This removes more shell scripts to improve maintainability.

This now also works correctly in userspace, so it can be used for
running LinuxKit images in Docker and other such use cases.

It is a literal conversion of the shell scripts with a few small
tweaks.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-09-18 11:45:59 -07:00