File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -107,3 +107,18 @@ yourself for use with `light-containerd`:
107
107
USERNAME=$( whoami) # Alternatively, use a user group that you belong to.
108
108
sudo usermod --add-subuids 165536-169631 --add-subgids 165536-169631 " $USERNAME "
109
109
```
110
+
111
+ ### 2) System must support ` cgroup ` V2
112
+
113
+ > Required for _ container pause/resume_
114
+
115
+ At the time of writing, only Fedora Linux ≥31 adopts ` cgroup ` V2 by default.
116
+ Provided you are running ` systemd ` ≥226 with Linux ≥4.2, you may add the
117
+ following kernel boot parameter and restart to enable ` cgroup ` V2:
118
+
119
+ ``` text
120
+ systemd.unified_cgroup_hierarchy=1
121
+ ```
122
+
123
+ This mounts both ` cgroupfs ` and ` cgroupfs2 ` in a unified filesystem hierarchy,
124
+ safely allowing any existing ` cgroup ` V1 applications to continue working.
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ impl Container {
45
45
let child = Command :: new ( CONMON_BIN )
46
46
. stdout ( Stdio :: piped ( ) )
47
47
. stderr ( Stdio :: piped ( ) )
48
- . args ( & [ "--syslog" , "--log-level=debug" ] )
48
+ . arg ( "--log-level=debug" )
49
+ . arg ( "--systemd-cgroup" ) // Required for rootless pause/resume.
49
50
. arg ( "--terminal" ) // Passes `--console-sock` to `crun`.
50
51
. args ( & [ "--cid" , & id] )
51
52
. args ( & [ "--cuuid" , & uuid_str] )
Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ async fn main() -> anyhow::Result<()> {
79
79
// TODO: Use `warp` to host REST endpoints.
80
80
let engine = Engine :: new ( ) ;
81
81
engine. create ( "busybox" ) . await ?;
82
- tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( 1000 ) ) . await ;
82
+ tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( 5 ) ) . await ;
83
+ engine. pause ( "busybox" ) . await ?;
84
+ tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( 5 ) ) . await ;
85
+ engine. resume ( "busybox" ) . await ?;
86
+ tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( 5 ) ) . await ;
83
87
Ok ( ( ) )
84
88
}
You can’t perform that action at this time.
0 commit comments