Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. # Systemd Unit file for Handle Service used by DSpace
  2. #
  3. # On hosts that use systemd, like RHEL7, this can be used to auto-start
  4. # the handle service and provide the familiar "servicectl start|status|stop"
  5. # commands for controlling execution.
  6. #
  7. # To install:
  8. #
  9. # 1) As dspace:
  10. # REQUIRED:
  11. # - Rename dspace/bin/start-handle-server to run-handle-server,
  12. # and remove "nohup" and the trailing ampersand from the last line.
  13. # OPTIONAL:
  14. # - Create start-handle-server, with the following lines, not indented:
  15. # #!/bin/sh
  16. # sudo systemctl start handle
  17. # ..and make sure it's executable (e.g. chmod 755 start-handle-server)
  18. # 2) As root:
  19. # REQUIRED:
  20. # - Copy this file into /etc/systemd/system and change the path for
  21. # ExecStart's value as appropriate.
  22. # - Run the following to install and make it start at system startup:
  23. # systemctl daemon-reload
  24. # systemctl enable handle
  25. # OPTIONAL:
  26. # - Modify /etc/sudoers (using visudo) to allow the dspace user
  27. # to run "sudo systemctl start|stop|status handle" with no password:
  28. # dspace ALL=(root) NOPASSWD: /bin/systemctl start handle
  29. # dspace ALL=(root) NOPASSWD: /bin/systemctl stop handle
  30. # dspace ALL=(root) NOPASSWD: /bin/systemctl status handle
  31.  
  32. [Unit]
  33. Description=Handle Service
  34. After=syslog.target network.target
  35.  
  36. [Service]
  37. Type=simple
  38. ExecStart=/opt/dspace/dspace/bin/run-handle-server
  39. ExecStop=/bin/kill $MAINPID
  40. User=dspace
  41. Group=dspace
  42.  
  43. [Install]
  44. WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement