Skip to main content

install_systemd

Function install_systemd 

Source
pub fn install_systemd(binary: &str, group: &str) -> Result<()>
Expand description

Installs the natmap daemon as a systemd service.

Performs the following steps:

  1. Copies the current binary to binary (unless already at that path).
  2. Creates the group system group if it does not exist.
  3. Adds the current user to the group (requires re-login to take effect).
  4. Writes a systemd service unit to /etc/systemd/system/natmap.service.
  5. Runs systemctl daemon-reload, then systemctl enable --now natmap.