centos-user-mode.unit 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # See https://serverfault.com/questions/936985/cannot-use-systemctl-user-due-to-failed-to-get-d-bus-connection-permission
  2. # for why we have to do this kind of thing on CentOS/AmazonLinux
  3. [Unit]
  4. Description=User Manager for UID %i
  5. After=systemd-user-sessions.service
  6. # These are present in the RHEL8 version of this file except that the unit is Requires, not Wants.
  7. # It's listed as Wants here so that if this file is used in a RHEL7 settings, it will not fail.
  8. # If a user upgrades from RHEL7 to RHEL8, this unit file will continue to work until it's
  9. # deleted the next time they upgrade Tableau Server itself.
  10. After=user-runtime-dir@%i.service
  11. Wants=user-runtime-dir@%i.service
  12. [Service]
  13. LimitNOFILE=infinity
  14. LimitNPROC=infinity
  15. User=%i
  16. PAMName=systemd-user
  17. Type=notify
  18. # PermissionsStartOnly is deprecated and will be removed in future versions of systemd
  19. # This is required for all systemd versions prior to version 231
  20. PermissionsStartOnly=true
  21. ExecStartPre=/bin/loginctl enable-linger %i
  22. ExecStart=-/lib/systemd/systemd --user
  23. Slice=user-%i.slice
  24. KillMode=mixed
  25. Delegate=yes
  26. TasksMax=infinity
  27. Restart=always
  28. RestartSec=15
  29. [Install]
  30. WantedBy=default.target