service and command line?

2003-04-28
2003-06-18
  • Stefano Scalas
    Stefano Scalas
    2003-04-28

    wis it possible to admin lmule by a prompt, i.e through telnet or ssh?
    and is possible to use lmule like a service,
    and admin it with a separate (g)ui?
    thanks

     
    • Mario Lipinski
      Mario Lipinski
      2003-04-28

      not by now. but im looking forward to learn c++ and trieing an emule clone realising that.

       
    • Honoré David
      Honoré David
      2003-05-10

      Tip :
        Use VNC ...

        with a script start a vncserver and lmule by something like this
           #!/bin/bash
           xvncserver :9;
           DISPLAY=:9 lmule

        use a simple windows manager like ratpoison.

      now just make a script in service directory who start or stop lmule and vncserver.

      a deamonizer program can be usefull to detach lmule from any console (I wrote one. look at http://code.thorgull.homeip.net/codeview.html?file=runasdaemon\)

      I am working on these scripts... if someone interested, contact thorgull@skynet.be

       
    • Miquel A. Juan
      Miquel A. Juan
      2003-06-18

      Hi all,

      The link does not work.... :(
      I find this one and I've modified (as you can see my level of programing script is very low) and it works....

      #!/bin/sh
      #
      # Author: Neo_CH
      # Version: 0.41
      #
      # This file check if xmule is not running
      #
      #
      # ++++++++++++++++++++++++++++++++++++++++++
      #
      # CHANGELOG
      #
      # Version 0.41
      # ------------
      # 2003-05-01
      #
      # Added 2nd check before restart xMule.
      #
      # Version 0.4
      # -----------
      # 2003-05-01
      #
      # First public release
      #

      alias echo='/usr/X11R6/bin/xmessage -timeout 2 " "'

      PROGRAM=lmule
      BIN=/usr/local/bin/lmule
      TCPPORT=4662
      UDPPORT=4672

      if ! ps -e | grep ${PROGRAM} > /dev/null; then
      echo "Damn, ${PROGRAM} is not running!"
      DATE=`date`
      echo "Check date: ${DATE}"

      echo
      echo "I'll restart ${PROGRAM}..."

      # This is required if you use vncserver
      # descomment above 2 lines if you don't use vncserver
      #echo " - Setting up DISPLAY (required for VNC)..."
      export DISPLAY=:1.0

      # Sometimes this is usefull to kill remaining xmule process
      echo " - Trying to kill process using port ${TCPPORT}/TCP..."
      fuser -vk ${TCPPORT}/tcp
      echo " - Trying to kill process using port ${UDPPORT}/UDP..."
      fuser -vk ${UDPPORT}/udp

      # Wait a little bit
      echo " - Waiting 15 seconds before starting port tests..."
      sleep 15s

      #
      # Check if TCP Port is free (otherwise you'll have a LowID...)
      #
      echo " - Loading network connections. This may take some time..."
      while netstat -ta | grep ${TCPPORT} > /dev/null; do
      echo " - Port ${TCPPORT} is not free. Waiting 10 seconds"
      sleep 10s
      echo " - Reloading network connections. This may take some time..."
      done
      echo " - Port ${TCPPORT} seems to be free"

      # Wait some more time
      echo " - Wait 15 seconds (I want to be sure port ${TCPPORT} is free)..."
      sleep 15s

      # Check another time if program is not running before restart it
      if ! ps -e | grep ${PROGRAM} > /dev/null; then
      echo " - Starting ${PROGRAM}"
      ${BIN} &

      DATE=`date`
      alias echo='echo'
      echo " - ${PROGRAM} restarted at ${DATE}" >> /var/log/lmulescript.log
      alias echo='/usr/X11R6/bin/xmessage -timeout 2 " "'
      else
      echo " - Someone restarted ${PROGRAM} before me. I'll not restart it."
      fi

      echo
      echo "Done."
      fi

      DATE=`date`

      alias echo='echo'
      echo "Script finishied at ${DATE}" >> /var/log/lmulescript.log

      And I schedule it every 20 minutes...