Browse Source

Put Dir and Owner in sequence

master
Adrian Heine 4 years ago
parent
commit
918e931728
  1. 7
      src/builder.rs
  2. 6
      src/locator.rs

7
src/builder.rs

@ -438,8 +438,10 @@ impl<D, P: AsRef<Path>> ImplementationBuilder<SystemdSocketService<D, P>> for De
fn prerequisites(_resource: &SystemdSocketService<D, P>) -> Self::Prerequisites {} fn prerequisites(_resource: &SystemdSocketService<D, P>) -> Self::Prerequisites {}
type Implementation = ( type Implementation = (
// First three could be parallel
FileSymbol<PathBuf, String>, FileSymbol<PathBuf, String>,
SystemdUserSessionSymbol<'static, String, StdCommandRunner>, SystemdUserSessionSymbol<'static, String, StdCommandRunner>,
OwnerSymbol<StdCommandRunner, StdCommandRunner, PathBuf, String>,
UserServiceSymbol<'static, PathBuf, String, StdCommandRunner>, UserServiceSymbol<'static, PathBuf, String, StdCommandRunner>,
); );
fn create( fn create(
@ -462,6 +464,11 @@ impl<D, P: AsRef<Path>> ImplementationBuilder<SystemdSocketService<D, P>> for De
}, },
), ),
SystemdUserSessionSymbol::new(user_name.0.clone(), &StdCommandRunner), SystemdUserSessionSymbol::new(user_name.0.clone(), &StdCommandRunner),
OwnerSymbol::new(
conf_path.as_ref().parent().unwrap().to_path_buf(),
user_name.0.clone(),
StdCommandRunner,
),
UserServiceSymbol::new( UserServiceSymbol::new(
socket_path.clone().into(), socket_path.clone().into(),
user_name.0.clone(), user_name.0.clone(),

6
src/locator.rs

@ -371,7 +371,7 @@ impl<D: Clone + AsRef<str>, P: Policy> ResourceLocator<PhpFpmPool<D>> for Defaul
impl<D: Clone + AsRef<str>, P, POLICY: Policy> ResourceLocator<SystemdSocketService<D, P>> impl<D: Clone + AsRef<str>, P, POLICY: Policy> ResourceLocator<SystemdSocketService<D, P>>
for DefaultLocator<POLICY> for DefaultLocator<POLICY>
{ {
type Prerequisites = (Dir<PathBuf>, Owner<PathBuf>);
type Prerequisites = Dir<PathBuf>;
fn locate( fn locate(
resource: &SystemdSocketService<D, P>, resource: &SystemdSocketService<D, P>,
) -> ( ) -> (
@ -385,9 +385,9 @@ impl<D: Clone + AsRef<str>, P, POLICY: Policy> ResourceLocator<SystemdSocketServ
( (
PathArtifact::from(format!("/var/tmp/{}-{}.socket", user_name.0, resource.1)), PathArtifact::from(format!("/var/tmp/{}-{}.socket", user_name.0, resource.1)),
PathArtifact::from(service_dir_path.join(format!("{}.service", resource.1))), PathArtifact::from(service_dir_path.join(format!("{}.service", resource.1))),
user_name.clone(),
user_name,
), ),
(Dir(service_dir_path), Owner(user_name.0, config)),
Dir(service_dir_path),
) )
} }
} }

Loading…
Cancel
Save