Creating custom scripts as system services under CentOS to start automatically

From , 4 Years ago, written in PowerShell, viewed 53 times.
URL https://pastebin.vip/view/99cd3843
  1. #!/bin/bash
  2. #
  3. # chkconfig: - 57 75
  4. # description: test service
  5.  
  6. start() {
  7. echo "Starting test ..."
  8. echo 3 >> /tmp/sunyu.txt
  9. }
  10.  
  11. stop() {
  12. echo "Stopping test ..."
  13. echo 2 >> /tmp/sunyu.txt
  14. }
  15.  
  16. # See how we were called.
  17. case "$1" in
  18.   start)
  19. start
  20. ;;
  21.   stop)
  22. stop
  23. ;;
  24.   restart|force-reload)
  25. stop
  26. start
  27. ;;
  28.   *)
  29. echo $"Usage: $0 {start|stop|restart|force-reload}"
  30. exit 2
  31. esac
  32.  
  33.  
  34. //shell/6702

Reply to "Creating custom scripts as system services under CentOS to start automatically"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website