ADCH++ Thread

can someone tell me where i can find help for this hub because bzr version compiles ok, it runs ok, but when I’m connected i can’t see anyone, even myself… heeelp :stuck_out_tongue: oh yes, i’ve tried with latest official dc++ and latest bzr linuxdcpp and hub is compiled on debian lenny. TIA

Did you make a debug build of ADCH++ ? if so you can always post the debug log of adch++ when it starts and whatever is going on with it here and we will gladly take a look at it and try to help you since part of the development team is here of ADCH++ or if you feel more like it better to take it up at the official bug tracker of ADCH++.

ADCH++ Lauchpad Bugreports Tracker
ADCH++ Launchpad Question Tracker

i made a small install script for Linux (Debian Distros)

echo Getting BZR Tool and Python
sudo apt-get install bzr python
echo Getting BZR Source of ADCH++ from launchpad
bzr branch lp:adchpp
cd adchpp
echo Installing the compilers and nessary development tools for compilation
sudo apt-get install gcc SCons swig
echo Creating a debug build of ADCH++ if you want a release build edit this script to scons mode=release
scons
clear
echo edit your adchpp.xml before going any further !!
wait
cp -rf etc /etc/adchpp
cp -rf plugins/Script/examples build/debug-default/bin/Scripts

my psychic powers tell me you’re trying to connect using “localhost:2780” (or whichever port number you’ve chosen), and you’re forgetting to prepend that with “adc://” (by default DC++ assumes the hub is an NMDC).

nice script, same should be usable in Red Hat / Fedora / CentOS, except that “apt-get” will have to be replaced by “yum”.

Good psychic powers poy, where did you develop them? :smiley:
It’s a very often mistake, I even added it to DSHub GUI to start preventing it…

personal experience! :blush:

adc:// thing helped :slight_smile: i didn’t realize it was mandatory :unamused:
here’s some info:

server-1:/etc/adchpp# ls -R
.:
adchpp.xml  logs  Script.xml

./logs:
adchpp200902.log
server-1:/etc/adchpp#



server-1:/etc/adchpp# cat logs/adchpp200902.log
2009-02-25 19:50:50: SocketManager: Starting
2009-02-25 19:50:50: ScriptManager: Starting
2009-02-25 19:50:50: LuaScript: Error loading file: cannot open access.lua: No such file or directory
2009-02-25 19:50:50: PluginManager: Script.so loaded
2009-02-25 19:50:50: BloomManager: Starting
2009-02-25 19:50:50: PluginManager: Bloom.so loaded
2009-02-25 19:50:50: adchpp: ADCH++ v2.2.0 (r0) Debug started as a daemon
server-1:/etc/adchpp#



server-1:/home/yapi/adchpp/build/debug-default/bin/Scripts# ls
access.lua  autil.lua  history.lua  json.lua
server-1:/home/yapi/adchpp/build/debug-default/bin/Scripts#

is this the right location for Scripts dir since LuaScript: Error loading file: cannot open access.lua: No such file or directory? paths in xml files are not modified, only basic info and added ServerIp part which is missing in original config…

and ServerIp is not functional ATM as i can see

server-1:/etc# netstat -apn|grep adc
tcp        0      0 0.0.0.0:2780            0.0.0.0:*               LISTEN      14793/adchppd
tcp        0      x.x.x.x:2780         x.x.x.x:36424        ESTABLISHED 14793/adchppd
server-1:/etc#

you have to edit your scripts.xml thats in the etc folder to the path where the scripts are located

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ScriptPlugin>
	<Engine language="lua" scriptPath="yourpathto/adchpp/plugins/Script/examples">
		<Script>access.lua</Script>
	</Engine>
</ScriptPlugin>

if you run into the problem with “your ip is” the run

export LUA_PATH=’/adchpp/build/debug-default/bin’

i ran into that today when i gave i trail run :stuck_out_tongue:

btw thx for giving it a run we are kinda in the testing phase with adch++

ok, id did fresh install with Toast’s script and it’s working great, except SCons pkg which should be “scons”. now

Script.xml is:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ScriptPlugin>
        <Engine language="lua" scriptPath="/home/yapi/adchpp/build/debug-default/bin/Scripts/">
                <Script>access.lua</Script>
        </Engine>
</ScriptPlugin>

then:
export LUA_PATH=’/home/yapi/adchpp/build/debug-default/bin’

and log file is:

2009-02-25 21:55:51: SocketManager: Starting
2009-02-25 21:55:51: ScriptManager: Starting
2009-02-25 21:55:51: LuaScript: Error loading file: error loading module 'luadchpp' from file '/home/yapi/adchpp/build/debug-default/bin':
        cannot read /home/yapi/adchpp/build/debug-default/bin: Is a directory
2009-02-25 21:55:51: PluginManager: Script.so loaded
2009-02-25 21:55:51: BloomManager: Starting
2009-02-25 21:55:51: PluginManager: Bloom.so loaded
2009-02-25 21:55:51: adchpp: ADCH++ v2.2.0 (r0) Debug started as a daemon

without export part it was:

2009-02-25 21:36:04: SocketManager: Starting
2009-02-25 21:36:04: ScriptManager: Starting
2009-02-25 21:36:04: LuaScript: Error loading file: access.lua:8: module 'luadchpp' not found:
        no field package.preload['luadchpp']
        no file './luadchpp.lua'
        no file '/usr/local/share/lua/5.1/luadchpp.lua'
        no file '/usr/local/share/lua/5.1/luadchpp/init.lua'
        no file '/usr/local/lib/lua/5.1/luadchpp.lua'
        no file '/usr/local/lib/lua/5.1/luadchpp/init.lua'
        no file './luadchpp.so'
        no file '/usr/local/lib/lua/5.1/luadchpp.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file 'luadchpp.so'
2009-02-25 21:36:04: PluginManager: Script.so loaded
2009-02-25 21:36:04: BloomManager: Starting
2009-02-25 21:36:04: PluginManager: Bloom.so loaded
2009-02-25 21:36:04: adchpp: ADCH++ v2.2.0 (r0) Debug started as a daemon

now, what am I doing wrong ?! :confused:

Now your at the same place as me this is the tricky part poy tried to help me with this earlier at DCDev but we didn’t find a solution i will however ask Arne (lead developer of ADCH++) about the solution atm your hub works everyone else can connect to it but not you so once the LUA IP check works then everything its okey.

Ok. Here’s solution :slight_smile:

mkdir -p /usr/local/lib/lua/5.1
cp /path-to-the-adch++-dir/adchpp/build/debug-default/bin/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/path-to-the-adch++-dir/adchpp/build/debug-default/bin/Scripts/?.lua'

and log file is:

2009-02-26 00:42:04: SocketManager: Starting
2009-02-26 00:42:04: ScriptManager: Starting
2009-02-26 00:42:04: LuaScript: Loaded access.lua
2009-02-26 00:42:04: PluginManager: Script.so loaded
2009-02-26 00:42:04: BloomManager: Starting
2009-02-26 00:42:04: PluginManager: Bloom.so loaded
2009-02-26 00:42:04: adchpp: ADCH++ v2.2.0 (r0) Debug started as a daemon

if it’s not working for u try
sudo apt-get install lua5.1 liblua5.1-0

Thank you :slight_smile: nice to have someone to test with now to start messing with python and making a start up script :slight_smile:

#!/bin/bash
# adchppd install script version 1.0 
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
sudo apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
sudo apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
sudo cp -rf etc build/debug-default/bin/etc
sudo cp -rf plugins/Script/examples build/debug-default/bin/Scripts
sudo apt-get install lua5.1 liblua5.1-0
sudo mkdir -p /usr/local/lib/lua/5.1
sudo cp build/debug-default/bin/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/home/toast/adchpp/build/debug-default/bin/Scripts/?.lua'
echo "Install script done"

im thinking of rewriting the script so it puts everything in its default place like usr/bin/adchpp for the app and config in etc/adchpp that would be more easier for newbies to work with

having some troubles retrieving the source with the script thou :frowning: so if anyone has good ideas about how to fix it please helpout and the lua path is not set correctly yet im not done putting everything to place

#!/bin/bash
# adchppd install script version 1.0 
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
sudo apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
sudo apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
sudo cp -rf /build/debug-default/bin /usr/bin/adchpp
sudo cp -rf etc /etc/adchpp
sudo apt-get install lua5.1 liblua5.1-0
sudo mkdir -p /usr/local/lib/lua/5.1/
sudo mkdir -p /usr/local/share/lua/5.1/
sudo cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
sudo cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"

but im still having troubles with getting the source from launchpad via bzr it just skips that part so im wondering how to go about fixxing that perhaps wait or if parameters or something kinda stuck here…

no problem :wink: i’m glad i can help :slight_smile: u r doing a great job with install script! Soon we’ll have totally automated install and run scripts and maybe pack it ?

here’s cron script to check if adchpp is running (it’s based on anope check script):

adchpp.chk

#!/bin/sh

# Crontab script for ADCH++
#
# To know how to install the crontab, read the INSTALL file.

###############################################################
# CONFIGURATION
###############################################################

# ADCH++ binary directory
ADCPATH=/home/yapi/adchpp/build/debug-default/bin

# Name of the pid file
ADCPIDF=adchpp.pid

# Name of the executable
ADCPROG=adchppd

# Parameters to pass to the executable
ADCARGS="-d -p"

###############################################################
#                 DON'T EDIT ANYTHING BELOW                   #
###############################################################

PATH=/bin:/usr/bin:/usr/local/bin

ADCPID=

cd $ADCPATH

if [ -f $ADCPIDF ]
then
        ADCPID=`cat $ADCPIDF`
        if [ `ps auwx | grep $ADCPROG | grep $ADCPID | grep -v -c grep` = 1 ]
        then
                exit
        fi
        rm -f $ADCPIDF
fi

./$ADCPROG $ADCARGS $ADCPIDF

i’ll make a startup script later today (for /etc/init.d/ ), and I was thinkig adding sys user to run adchpp so it would prevent possible xploitz and help us maintain hierarchy such as home dir for executable… What do u think?

#!/bin/bash
#
# adchppd startup script version 1.0 
# 
# This file is made for ADCH++ (http://adchpp.sf.net/)

# Specify config for adchppd.
. /etc/adchpp
# This part checks if network is up if its not it stops the startup script
# note: this might not work on every distribution so rem this comment if it causes problems
[[ ${NETWORKING} = "no" ]] && exit 0

stop (){
#This will kill any running adchppd so we dont get any erorrs.
echo "Checking so there isnt any current running adchppd processes."
for oldpid in `ps -A | grep adchppd | cut -c 0-6`; do
kill -9 $oldpid
if [[ $1 == "-v" ]]
then
echo $oldpid
fi
done
rm -f /var/run/adchppd.pid
}

start (){
#This will start the process.
if [[ $1 == "-v" ]]
then
echo "Starting adchppd process"
fi

servcount=`expr 0`
for cfile in `ls /etc/adchpp`; do
echo -n $cfile
echo -n " -> "
grep adchppd /etc/adchpp/$cfile
# This line will execute adchppd
#sudo -u nobody /usr/bin/adchppd /etc/adchpp/$cfile > /dev/null &
/usr/bin/adchppd /etc/adchpp/$cfile > /dev/null &
let servcount=servcount+1
done

#Create the pid file...
ps -A | grep adchppd | cut -c 0-6 > /var/run/adchppd.pid
#Creating pid file is done!
echo "adchppd is running now."
}

case "$1" in
start)
if [[ ! -e /var/run/adchppd.pid ]]
then
start $2

if [[ -e /var/run/adchppd.pid ]]
then
echo "Startup [SUCCESS]"
fi

else
if [[ $2 == "-v" ]]
then
echo "adchppd is already running checking pids..:"
#Checks before displaying pid file.
if [[ -e /var/run/adchppd.pid ]]
then
cat /var/run/adchppd.pid
fi
echo "Please kill any old adchppd processes."
else
echo "adchppd is already running please kill any old processes."
fi
echo "Startup [FAILED]"
fi
;;
restart)
stop $2
if [[ $2 == "-v" ]]
then
echo "Waiting for old adchppd processes to die.."
fi

sleep 4
start $2
if [[ -e /var/run/adchppd.pid ]]
then
echo "Startup [SUCCESS]"
fi
;;
stop)
if [[ -e /var/run/adchppd.pid ]];
then
stop $2
echo "adchppd shutdown [SUCCESS]"
else
echo "Couldnt find any adchppd processes trying to kill anyways.."
stop $2
fi
;;
*)
echo "Usage: adchppd (start|stop|restart) [-v]"

please check if it works okey

#!/bin/bash
# adchppd install script version 1.0a
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh
if [ `id -u` = 0 ]; then
echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
cp -rf /build/debug-default/bin/ /usr/bin/adchpp/
cp -rf etc /etc/adchpp
apt-get install lua5.1 liblua5.1-0
mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"
else
	echo please run as root
fi

still got that bzr problem :frowning: but mikejj helped me make it so that all sudo commands are gone and the scripts runs in as rootuser

#!/bin/bash
# adchppd install script version 1.0
# This file is made for ADCH++ (http://adchpp.sf.net/)
# Install script made by Toast (http://www.adcportal.com)
# This will start retrieving tools necessary for getting the source
# Before running this script make sure to edit your adchpp.xml to your needs its located in adchpp/etc/
# Usage: sh adchpp_install_script.sh

if [ `id -u` != 0 ]; then
	echo please run as root
	exit
fi

echo installation starting...
echo retriving Launchpad Bazaar Tool and Python
apt-get install bzr python
bzr branch lp:adchpp
cd adchpp
echo "This will compile the source, getting nessary compilers for making ADCH++"
apt-get install gcc scons swig
echo Edit the line to scons to "scons mode=release" if you want a release build instead of debug build
scons
echo now the script will start to copy the files to its correct place
cp -rf /build/debug-default/bin/ /usr/bin/adchpp/
cp -rf etc /etc/adchpp
apt-get install lua5.1 liblua5.1-0
mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/
export LUA_PATH='/usr/local/share/lua/5.1/?.lua'
echo "Install script done"

Made the if nicer. Maybe fix the error you sent me in pm ? :slight_smile:

P.S. Is this needed ? The inclusion of this is why i don’t really wanna run it.

mkdir -p /usr/local/lib/lua/5.1/
mkdir -p /usr/local/share/lua/5.1/
cp -rf plugins/Script/examples /usr/local/share/lua/5.1/
cp /usr/bin/adchpp/luadchpp.so /usr/local/lib/lua/5.1/

tnx mikejj kinda beginner at bash so any help i can get is just fine :slight_smile:

@MikeJJ

well there are compile instructions in source but not install ones. you can compile the source but it just wont work because scons doesn’t copy files where they supposed to be :frowning:

@Toast
great work :slight_smile: i was thinking to write a init.d script with LSB support http://wiki.debian.org/LSBInitScripts but your’s good. maybe you should only add LSB part?

not that good sry but we can perhaps co-lab :slight_smile: