Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Ubuntu Init Script?

forums forums Monyog Monyog Deployment Ubuntu Init Script?

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #12299
      aemadrid
      Member

      Has anybody come up with a good init script for Debian/Ubuntu and would like to share?

    • #32119
      peterlaursen
      Participant

      Do you request an init script tio start MONyog in Ubuntu – so that MONyog will start with the OS?

    • #32120
      aemadrid
      Member

      Yes, exactly. RH systems get it with the RPM but the tar file doesn't have anything like it.

      'peterlaursen' wrote:

      Do you request an init script tio start MONyog in Ubuntu – so that MONyog will start with the OS?

    • #32121

      You can install scripts like below in the init.d

      Step 1 : Created a script called MONyogd in the /etc/init.d/

      Step 2 : Copy the following into the script. ( Change the MONyog installation directory if it is not /usr/local/ , it is defined in INSTALLDIR variable in the script)

      #!/bin/bash

      INSTALLDIR=”/usr/local”

      MONYOGBIN=”$INSTALLDIR/MONyog/bin/MONyog”

      case “$1” in

      'start')

      echo “Starting MONyog: “

      if [ $((`pgrep MONyog-bin | wc -l`)) -gt 0 ]; then

      echo “MONyog is already running.”

      else

      # Start MONyog.

      $MONYOGBIN start

      if [ $((`pgrep MONyog-bin | wc -l`)) -gt 0 ]; then

      echo “MONyog started successfully!”

      else

      echo “Unable to start MONyog.”

      exit 0

      fi

      fi

      ;;

      'stop')

      if [ $((`pgrep MONyog-bin | wc -l`)) -gt 0 ]; then

      echo -n “Sending MONyog signal to stop: “

      pkill -15 -x MONyog-bin

      echo -n “Shutting down: “

      echo ” “

      echo “MONyog stopped successfully!”

      else

      echo “MONyog is not in memory…”

      fi

      ;;

      'reload'|'restart')

      echo “Restarting MONyog…”

      $0 stop

      $0 start

      ;;

      'status')

      if [ $((`pgrep MONyog-bin`)) -gt 0 ]; then

      echo -n “MONyog is running!”

      echo ” “

      else

      echo -n “MONyog is NOT running!”

      echo ” “

      fi

      ;;

      *)

      echo “Usage: $0 {start|stop|restart|reload|status}”

      exit 1

      ;;

      esac

      Step 3 : make the script executable by chmod +x /etc/init.d/MONyogd

      Step 4 : Use Debian utility update-rc.d to install the script.

      update-rc.d MONyogd defaults

      This will make MONyog start up in boot time. You can also issue service MONyogd start/stop/restart/status any time to have the respective action done.

    • #32122
      aemadrid
      Member

      Thanks so much! I hacked one out of nginx but this is so much cleaner.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.