gusto2

Linux service

Aug 12th, 2015
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # myservice  Startup script for the my application
  4. #
  5. # chkconfig: - 85 15
  6. # description: my service implementation
  7. # processname: myservice
  8. #
  9. ### BEGIN INIT INFO
  10. # Provides: myservice  
  11. # Description: myservice script
  12. ### END INIT INFO
  13.  
  14. export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
  15. username=service_user
  16.  
  17. start () {
  18.  echo "Starting eGovCon platform: "
  19.  su ${username} -c command_to_run
  20.  echo
  21. }
  22.  
  23. run () {
  24.  echo "Running eGovCon platform: "
  25.  su ${username} -c command_to_run
  26. }
  27.  
  28. stop () {
  29.  echo "Stopping eGovCon platform: "
  30.  su ${username} -c command_to_run
  31. }
  32.  
  33.  
  34. case "$1" in
  35.   start)
  36.         start
  37.         ;;
  38.   stop)
  39.         stop
  40.         ;;
  41.   run)
  42.         run
  43.         ;;
  44.   *)
  45.         echo $"Usage: $0 {start|stop|run}"
  46.         exit 1
  47. esac
  48. exit 0
Advertisement
Add Comment
Please, Sign In to add comment