HOWTO: Run a StrongDC++ on a headless linux/freebsd server
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

HOWTO: Run a StrongDC++ on a headless linux/freebsd server

Started by deseven, 07 December, 2009, 10:23:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deseven

You may know, that the console DC-client software in linux/freebsd is terrible.
If you need to share some files from you server to other users - there are not many options.
You can use microDC, for example, but be ready for bugs, instability and lack of many important features (such as magnet links).

But you can run any StrongDC++ clone, such as FlylinkDC, Greylink, ApexDC++, etc.

So, basic requirements are:
- any linux distro or FreeBSD
- Xvfb (it called xorg-vfbserver in FreeBSD)
- wine 1.0.1 or higher

First of all you should configure your client in Windows or just edit Settings\DCPlusPlus.xml and Settings\Favorites.xml files.

Make sure that MagnetAction set to 1 and MagnetAsk set to 0.

Then just save this script with any desired name ("dc" for example) and edit CLIENTPATH variable:
#!/bin/bash

CLIENTPATH="/serv/greylink/greylink.exe"
DISPNUM=":1"
WINEPATH=`which wine`
XVFBPATH=`which Xvfb`

case "$1" in
    start)
        echo -n $"Starting: "
        nohup $XVFBPATH $DISPNUM > Xvfb.log &
        export DISPLAY=$DISPNUM
        nohup $WINEPATH $CLIENTPATH > wine.log &
        echo $"[OK]"
        ;;
    stop)
        echo -n $"Stopping: "
        nohup killall wine > /dev/null &
        nohup killall Xvfb > /dev/null &
        echo $"[OK]"
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    start-debug)
        echo -n $"Starting in interactive mode: "
        nohup $XVFBPATH $DISPNUM > Xvfb.log &
        export DISPLAY=$DISPNUM
        $WINEPATH $CLIENTPATH
        $0 stop
        ;;
    magnet)
        echo -n $"Sending magnet: "
        export DISPLAY=$DISPNUM
        $WINEPATH $CLIENTPATH /magnet $2
        echo $"[OK]"
        ;;
    *)
        echo $"Usage: start|start-debug|stop|restart|magnet"
        exit 1

esac

exit 1



Use "dc start" to start your DC-client, "dc stop" to stop it, "dc restart" to restart it, "dc start-debug" to check for possible wine problems and "dc magnet <magnet-link-with-quotes>" to add a magnet-link.
FreeBSD users must also check the bash path in the first line of the script.

Tested in CentOS 5.3, Ubuntu 9.10 and FreeBSD 7.2.

Hope this will help someone. Good luck and sorry for my english :)

bastya_elvtars

For *BSD one needs to install bash from ports/pkgsrc as it is not supplied by default. Great work by the way, although a Bourne-version would be better. (I am not that huge shell guru so I cannot mod it, just playing a PITA as usual. :P) Anyway, thanks for this howto.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk