tpsgi.tmpl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. [Unit]
  2. Description=tPSGI for __DOMAIN__
  3. Wants=multi-user.target
  4. After=multi-user.target
  5. [Install]
  6. WantedBy=multi-user.target
  7. [Service]
  8. Type=forking
  9. PIDFile=__REPLACEME__/run/tpsgi.pid
  10. Environment=PATH='__PERL5BIN__' HOME=__REPLACEME__/
  11. ExecStart=__REPLACEME__/service/tpsgi.sh
  12. # Secrets the application needs and should not be storing next to itself. Taken
  13. # from the system credential store -- /etc/credstore, or /etc/credstore.encrypted
  14. # for one sealed to this machine's TPM -- and put in a ramdisk under
  15. # /run/credentials that only this service can read.
  16. #
  17. # Not fatal when there is nothing there, which is the point of ImportCredential
  18. # over LoadCredential: an installation with no secrets to hand over is an
  19. # installation that starts normally.
  20. #
  21. # The workers end up chrooted into WorkingDirectory and /run/credentials is
  22. # outside it, so service/tpsgi.sh reads what it needs before that happens.
  23. ImportCredential=tcms-vault
  24. WorkingDirectory=__REPLACEME__/
  25. Restart=always
  26. OOMPolicy=stop
  27. ExecReload=kill -HUP $MAINPID
  28. AmbientCapabilities=CAP_SYS_RESOURCE CAP_SYS_NICE
  29. LockPersonality=yes
  30. MemoryDenyWriteExecute=yes
  31. OOMPolicy=continue
  32. PrivateDevices=yes
  33. PrivateTmp=true
  34. ProtectClock=yes
  35. ProtectControlGroups=yes
  36. ProtectHome=read-only
  37. ProtectHostname=yes
  38. ProtectKernelLogs=yes
  39. ProtectKernelModules=yes
  40. ProtectKernelTunables=yes
  41. ProtectSystem=yes
  42. RestrictNamespaces=yes
  43. RestrictRealtime=yes
  44. RestrictSUIDSGID=yes
  45. NoNewPrivileges=yes