File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ Documentation=https://github.com/coreos/bootupd
6
6
Type =oneshot
7
7
ExecStart =/usr/bin/bootupctl update
8
8
RemainAfterExit =yes
9
+ # Keep this stuff in sync with SYSTEMD_ARGS_BOOTUPD in general
10
+ PrivateNetwork =yes
11
+ ProtectHome =yes
12
+ KillMode =mixed
9
13
MountFlags =slave
10
14
11
15
[Install]
Original file line number Diff line number Diff line change @@ -6,20 +6,17 @@ use log::LevelFilter;
6
6
use std:: os:: unix:: process:: CommandExt ;
7
7
use std:: process:: { Command , Stdio } ;
8
8
9
- static SYSTEMD_ARGS_BOOTUPD : & [ & str ] = & [
10
- "--unit" ,
11
- "bootupd" ,
12
- "--property" ,
9
+ static SYSTEMD_ARGS_BOOTUPD : & [ & str ] = & [ "--unit" , "bootupd" , "--pipe" ] ;
10
+
11
+ /// Keep these properties (isolation/runtime state) in sync with
12
+ /// the systemd units in contrib/packaging/*.service
13
+ static SYSTEMD_PROPERTIES : & [ & str ] = & [
13
14
"PrivateNetwork=yes" ,
14
- "--property" ,
15
15
"ProtectHome=yes" ,
16
16
// While only our main process during update catches SIGTERM, we don't
17
17
// want systemd to send it to other processes.
18
- "--property" ,
19
18
"KillMode=mixed" ,
20
- "--property" ,
21
19
"MountFlags=slave" ,
22
- "--pipe" ,
23
20
] ;
24
21
25
22
/// `bootupctl` sub-commands.
@@ -171,6 +168,11 @@ fn ensure_running_in_systemd() -> Result<()> {
171
168
. wait ( ) ?;
172
169
let r = Command :: new ( "systemd-run" )
173
170
. args ( SYSTEMD_ARGS_BOOTUPD )
171
+ . args (
172
+ SYSTEMD_PROPERTIES
173
+ . into_iter ( )
174
+ . flat_map ( |& v| [ "--property" , v] ) ,
175
+ )
174
176
. args ( std:: env:: args ( ) )
175
177
. exec ( ) ;
176
178
// If we got here, it's always an error
You can’t perform that action at this time.
0 commit comments