fn instantiate_template<U: AsRef<str>, I: AsRef<str>>(
    normal_dir: PathBuf,
    unit: U,
    instance: I,
) -> Result<String> {
    let instance_unit = systemd::template_unit_name(&unit, instance)?;
    let instance_file = normal_dir.join(&instance_unit);
    let template_src = PathBuf::from(PROVIDER_ROOT).join(unit.as_ref());
    symlink(&template_src, &instance_file).with_context(|| {
        format!(
            "failed to symlink {:?} -> {:?}",
            instance_file, template_src
        )
    })?;
    Ok(instance_unit)
}
// This unit file helper intentionally not implemented in systemd.rs. The
// generator has to operate on files since systemd might not be ready while the
// generator is running. Post-generator interactions with systemd should happen
// over dbus, not filesystem mangling. See the systemd generator docs for more
// details about the limitations imposed on generators.
// https://www.freedesktop.org/software/systemd/man/systemd.generator.html#Notes%20about%20writing%20generators
This unit file helper intentionally not implemented in systemd.rs. The
generator has to operate on files since systemd might not be ready while the
generator is running. Post-generator interactions with systemd should happen
over dbus, not filesystem mangling. See the systemd generator docs for more
details about the limitations imposed on generators.
This unit file helper intentionally not implemented in systemd . rs . The generator has to operate on files since systemd might not be ready while the generator is running . Post - generator interactions with systemd should happen over dbus not filesystem mangling . See the systemd generator docs for more details about the limitations imposed on generators .
fn instantiate_template<U: AsRef<str>, I: AsRef<str>>(
    normal_dir: PathBuf,
    unit: U,
    instance: I,
) -> Result<String> {
    let instance_unit = systemd::template_unit_name(&unit, instance)?;
    let instance_file = normal_dir.join(&instance_unit);
    let template_src = PathBuf::from(PROVIDER_ROOT).join(unit.as_ref());
    symlink(&template_src, &instance_file).with_context(|| {
        format!(
            "failed to symlink {:?} -> {:?}",
            instance_file, template_src
        )
    })?;
    Ok(instance_unit)
}
fn instantiate_template < U : AsRef < str > , I : AsRef < str > > ( normal_dir : PathBuf , unit : U , instance : I , ) -> Result < String > { let instance_unit = systemd :: template_unit_name ( & unit , instance ) ? ; let instance_file = normal_dir . join ( & instance_unit ) ; let template_src = PathBuf :: from ( PROVIDER_ROOT ) . join ( unit . as_ref ( ) ) ; symlink ( & template_src , & instance_file ) . with_context ( | | { format ! ( " " instance_file template_src ) } ) ? ; Ok ( instance_unit ) }
This unit file helper intentionally not implemented in systemd.rs.
This unit file helper intentionally not implemented in systemd . rs .
normal_dir
PathBuf
unit
U
instance
I
normal_dir
PathBuf
unit
U
instance
I