Write unshare pid into file for scripting purposes

This commit is contained in:
Koi to Coco 2024-06-01 10:26:16 +00:00
parent 4554d3bc55
commit 07ffbe057c
No known key found for this signature in database
GPG key ID: 07E534E0D1EE29DB
2 changed files with 13 additions and 2 deletions

View file

@ -32,6 +32,11 @@ pub struct Args {
#[arg(long)]
pub unshare: bool,
/// Create a pidfile of `unshare` process when using `--unshare`.
#[cfg(target_os = "linux")]
#[arg(long)]
pub unshare_pidfile: Option<String>,
/// File descriptor for UNIX datagram socket meant to transfer
/// network sockets from global namespace to the new one.
/// See `unshare(1)`, `namespaces(7)`, `sendmsg(2)`, `unix(7)`.
@ -103,6 +108,8 @@ impl Default for Args {
#[cfg(target_os = "linux")]
unshare: false,
#[cfg(target_os = "linux")]
unshare_pidfile: None,
#[cfg(target_os = "linux")]
socket_transfer_fd: None,
#[cfg(target_os = "linux")]
admin_command: Vec::new(),