A library for writing host-specific, single-binary configuration management and deployment tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
435 B

  1. use std::path::Path;
  2. pub fn fpm_pool_config<U: AsRef<str>, S: AsRef<Path>>(
  3. user_name: U,
  4. socket_path: S,
  5. max_children: usize,
  6. ) -> String {
  7. format!(
  8. "[{0}]
  9. user = {0}
  10. group = www-data
  11. listen = {1}
  12. listen.owner = www-data
  13. pm = ondemand
  14. pm.max_children = {2}
  15. catch_workers_output = yes
  16. env[PATH] = /usr/local/bin:/usr/bin:/bin
  17. ",
  18. user_name.as_ref(),
  19. socket_path.as_ref().to_str().unwrap(),
  20. max_children,
  21. )
  22. }