File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -722,13 +722,9 @@ pub(crate) fn finalize_filesystem(fs: &Utf8Path) -> Result<()> {
722
722
Ok ( ( ) )
723
723
}
724
724
725
- fn require_systemd_pid1 ( ) -> Result < ( ) > {
725
+ fn require_host_pidns ( ) -> Result < ( ) > {
726
726
// We require --pid=host
727
- let pid = std:: fs:: read_link ( "/proc/1/exe" ) . context ( "reading /proc/1/exe" ) ?;
728
- let pid = pid
729
- . to_str ( )
730
- . ok_or_else ( || anyhow:: anyhow!( "Non-UTF8 /proc/1/exe" ) ) ?;
731
- if !pid. contains ( "systemd" ) {
727
+ if rustix:: process:: getpid ( ) . is_init ( ) {
732
728
anyhow:: bail!( "This command must be run with --pid=host" )
733
729
}
734
730
Ok ( ( ) )
@@ -809,7 +805,7 @@ async fn prepare_install(
809
805
) -> Result < Arc < State > > {
810
806
// We need full root privileges, i.e. --privileged in podman
811
807
crate :: cli:: require_root ( ) ?;
812
- require_systemd_pid1 ( ) ?;
808
+ require_host_pidns ( ) ?;
813
809
814
810
if cfg ! ( target_arch = "s390x" ) {
815
811
anyhow:: bail!( "Installation is not supported on this architecture yet" ) ;
You can’t perform that action at this time.
0 commit comments