@@ -29,15 +29,16 @@ use containerd_shim::{
29
29
monitor:: { Subject , Topic } ,
30
30
protos:: { events:: task:: TaskExit , protobuf:: MessageDyn } ,
31
31
util:: {
32
- convert_to_timestamp, read_options, read_runtime, read_spec, timestamp, write_str_to_file,
32
+ convert_to_timestamp, read_options, read_pid_from_file, read_runtime, read_spec, timestamp,
33
+ write_str_to_file,
33
34
} ,
34
35
Config , Context , DeleteResponse , Error , Flags , StartOpts ,
35
36
} ;
36
37
use log:: { debug, error, warn} ;
37
38
use tokio:: sync:: mpsc:: { channel, Receiver , Sender } ;
38
39
39
40
use crate :: {
40
- common:: { create_runc, has_shared_pid_namespace, ShimExecutor , GROUP_LABELS } ,
41
+ common:: { create_runc, has_shared_pid_namespace, ShimExecutor , GROUP_LABELS , INIT_PID_FILE } ,
41
42
container:: Container ,
42
43
processes:: Process ,
43
44
runc:: { RuncContainer , RuncFactory } ,
@@ -116,6 +117,7 @@ impl Shim for Service {
116
117
& opts,
117
118
Some ( Arc :: new ( ShimExecutor :: default ( ) ) ) ,
118
119
) ?;
120
+ let pid = read_pid_from_file ( & bundle. join ( INIT_PID_FILE ) ) . await ?;
119
121
120
122
runc. delete ( & self . id , Some ( & DeleteOpts { force : true } ) )
121
123
. await
@@ -124,6 +126,7 @@ impl Shim for Service {
124
126
// sigkill
125
127
resp. set_exit_status ( 137 ) ;
126
128
resp. set_exited_at ( timestamp ( ) ?) ;
129
+ resp. set_pid ( pid as u32 ) ;
127
130
Ok ( resp)
128
131
}
129
132
0 commit comments