Menu

run opendchub at startup

Help
greg
2002-12-08
2013-04-24
  • greg

    greg - 2002-12-08

    I succesfully installed opendchub on my "little" p150.
    I can run the deamon from command line and it works perfectly, but I want it to run at system startup and i can't find out how to do it.

    I tried to put it in /etc/init.d/ and /etc/rc3.d/ : it stucks when reaching it...

    Please help me, i don't want to log in at my "server" each time I start it up ...

     
    • Robert Dout

      Robert Dout - 2002-12-08

      I use Slackware and there is a startup script called rc.local in /etc/rc.d/. Its the last script ran before you can logon. Put it in the last script that is ran and it should work. i'm pretty sure that init.d is started very early so thats not a good idea. Thats about all i can give you. Please tell us what distro you are using.

       
    • Anonymous

      Anonymous - 2002-12-17

      I did it with freebsd by putting the following in rc.local:

      /usr/local/bin/opendchub > /dev/null && echo ' opendchub'

      I also stuck all the config files in /usr/local/etc/opendchub and symlinked /.opendchub and /root/.opendchub to it.

      Unfortunately, I don't think it's a horribly good idea to have it run as root and I'm sure that it would probably be better to write a wrapper script for it and have something running as root that simply forwards the port from something else. It would be nice if the hub used configuration and log files in the standard places. :-)

      --Bill

       
      • Cristian Magherusan

        i run Gentoo on my box and i've put this in /etc/conf.d/local.start:
        /usr/bin/opendchub > /dev/null && echo ' opendchub'
        It works just fine, but i don't know how secure it is. I just hope no one will crack my box :)

         
        • Stefan Richter

          Stefan Richter - 2006-08-14

          ich think that's a secure und comfortable posibility:

          1. create a user "opendchubuser"
          2. login this user
          3. start opendchub to configure it (port and so on ...)
          4. close opendchub (killall opendchub)
          5. create a short script for this user:
          #!/bin/bash
          cd /home/opendchubuser/.opendchub
          opendchub
          6. start this at startup:
          sudo -b -u opendchubuser -H /home/opendchubuser/script.sh
          7. now restart your server for testing :-P

           
    • Robert Dout

      Robert Dout - 2002-12-18

      a dc hub runs by default on port 411 which is only accessable by root. now when i send the data to the public hub i can specify the port which it runs on, but when someone connects manually just by typing the address,the default port is 411. running opendchub as root is just like running ftpd as root. there is very little chance of anyone getting access to your server through opendchub because it gives access to very specific services that only manipulate a small group of files if you have admin access. now if it was a dc client thats different.

       
    • Lost Soul

      Lost Soul - 2002-12-18

      No. All it takes is 1 buffer overflow or format string vulnerability to be found in opendchub, and your entire Linux/FreeBSD/etc. machine is officially hacked :)
      It's not the author's fault, as windows Direct Connect client and server defaults to port 411, so idealy opendchub should copy that, which it does.

      The simple way round it is to run opendchub on a port above 1024, and set up a port redirecting rule in iptables (Linux) redirecting port 411 to the new port.

       
    • Harri Suutari

      Harri Suutari - 2004-11-06

      Run the hub as normal user and then also run this script every minute with Cron. Modify the script as needed. And to get access via port 411, use firewall rules as mentioned above.

      ###
      #!/bin/bash

      RUNNING=$(fuser -n tcp "6666")
      if test -z "$RUNNING" ; then
        killall opendchub
        sleep 5
        ~/bin/opendchub
      fi
      ###

       

Log in to post a comment.