Use OsStr for systemd unit exec value

This commit is contained in:
Adrian Heine 2025-12-09 22:08:22 +01:00
parent 36b85ff350
commit d363254f6e
3 changed files with 10 additions and 8 deletions

View file

@ -5,6 +5,7 @@ use crate::artifacts::{
use crate::templates::php::FpmPoolConfig;
use std::hash::Hash;
use std::path::Path;
use std::ffi::OsStr;
pub trait Resource {
type Artifact;
@ -136,7 +137,7 @@ impl Resource for User {
}
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct SystemdSocketService<D, P>(pub D, pub &'static str, pub P, pub P, pub bool);
pub struct SystemdSocketService<D, P>(pub D, pub &'static str, pub Rc<OsStr>, pub P, pub bool);
impl<D, P> Resource for SystemdSocketService<D, P> {
type Artifact = (PathArtifact, PathArtifact, UserNameArtifact);
}
@ -179,7 +180,7 @@ impl<D, P, C> Resource for ServePhp<D, P, C> {
// Domain, service name, exec, static, dir
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct ServeService<D, P>(pub D, pub &'static str, pub P, pub P, pub P, pub bool);
pub struct ServeService<D, P>(pub D, pub &'static str, pub Rc<OsStr>, pub P, pub P, pub bool);
impl<D, P> Resource for ServeService<D, P> {
type Artifact = PathArtifact;
}
@ -187,7 +188,7 @@ impl<D> ServeService<D, Rc<Path>> {
pub fn new(
domain: D,
service_name: &'static str,
exec: impl Into<Rc<Path>>,
exec: impl Into<Rc<OsStr>>,
static_path: impl Into<Rc<Path>>,
working_directory: impl Into<Rc<Path>>,
is_nodejs: bool,