Author Topic: PtokaX Debian/Ubuntu Installer  (Read 21223 times)

0 Members and 1 Guest are viewing this topic.

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 111
  • Karma: +14/-0
  • secret things
    • Metin2 Hungarian Forum
PtokaX Debian/Ubuntu Installer
« on: 27 September, 2008, 20:12:47 »
Very first release..
It helps to download, compile and install PtokaX 0.4.1.1 into /usr/share/PtokaX
Tested only on Ununtu 8.04 ::)

Code: [Select]
#!/bin/sh

# install dependencies
echo " "
echo "Looking for dependencies and some other usefull package..."
echo " "

sudo apt-get install liblua5.1-0 liblua5.1-0-dev lua5.1 liblua5.1-filesystem0 liblua5.1-socket2 liblua5.1-sql-mysql-2 liblua5.1-sql-sqlite3-2 zlib1g-dev make g++

# get PtokaX source and extract
echo " "
echo "OK, I'll get the sources..."
echo " "

wget http://www.PtokaX.org/files/0.4.1.1-posix-src.tgz
tar -xf 0.4.1.1-posix-src.tgz
rm 0.4.1.1-posix-src.tgz

# Get tinyxml source and extract
wget http://garr.dl.sourceforge.net/sourceforge/tinyxml/tinyxml_2_5_3.tar.gz
tar -xf tinyxml_2_5_3.tar.gz
rm tinyxml_2_5_3.tar.gz

# copy needed files to PtokaX/tinyxml/src/
cp tinyxml/tinystr.cpp PtokaX/tinyxml/src/
cp tinyxml/tinystr.h PtokaX/tinyxml/src/
cp tinyxml/tinyxml.cpp PtokaX/tinyxml/src/
cp tinyxml/tinyxml.h PtokaX/tinyxml/src/
cp tinyxml/tinyxmlerror.cpp PtokaX/tinyxml/src/
cp tinyxml/tinyxmlparser.cpp PtokaX/tinyxml/src/
rm -r tinyxml

echo " "
echo "Compiling PtokaX. This may take some time..."
echo " "

# build PtokaX
cd PtokaX/tinyxml
make
cd ..
make
chmod +x ./PtokaX

# copy it...
sudo cp -f ./PtokaX /usr/bin/
sudo cp -fr cfg.example /usr/share/PtokaX/
sudo cp -fr scripting.docs /usr/share/PtokaX/
sudo cp -fr language /usr/share/PtokaX/
sudo chmod 777 /usr/share/PtokaX

echo " "
echo "It's ready. Good bye!"
echo " "

PtokaX forum

PtokaX Debian/Ubuntu Installer
« on: 27 September, 2008, 20:12:47 »

Offline kotur

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: PtokaX Debian/Ubuntu Installer
« Reply #1 on: 12 October, 2008, 15:41:45 »
Hi,
I have some problems with instaling on CentOS 5. Problem begins after I type this second MAKE.
Code: [Select]
[i]" # build PtokaX
cd PtokaX/tinyxml
make
cd ..
make
chmod +x ./PtokaX" [/i]

It writes this:
[root@server PtokaX]# make
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/ClientTagManager.cpp -o /usr/src/PtokaX/obj/ClientTagManager.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/colUsers.cpp -o /usr/src/PtokaX/obj/colUsers.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/DcCommands.cpp -o /usr/src/PtokaX/obj/DcCommands.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/DeFlood.cpp -o /usr/src/PtokaX/obj/DeFlood.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/eventqueue.cpp -o /usr/src/PtokaX/obj/eventqueue.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/globalQueue.cpp -o /usr/src/PtokaX/obj/globalQueue.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/hashBanManager.cpp -o /usr/src/PtokaX/obj/hashBanManager.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/hashUsrManager.cpp -o /usr/src/PtokaX/obj/hashUsrManager.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/hashRegManager.cpp -o /usr/src/PtokaX/obj/hashRegManager.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/HubCommands.cpp -o /usr/src/PtokaX/obj/HubCommands.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/IP2Country.cpp -o /usr/src/PtokaX/obj/IP2Country.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/LanguageManager.cpp -o /usr/src/PtokaX/obj/LanguageManager.o
g++ -g -Wall -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 -c /usr/src/PtokaX/src/LuaBanManLib.cpp -o /usr/src/PtokaX/obj/LuaBanManLib.o
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:260: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetPermBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:333: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetTempBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:406: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetRangeBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:588: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetRangePermBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:647: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int GetRangeTempBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:696: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int Unban(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:755: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int UnbanPerm(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:791: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int UnbanTemp(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:827: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int UnbanAll(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:861: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int UnbanPermAll(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:892: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int UnbanTempAll(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:923: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int RangeUnban(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:957: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int RangeUnbanPerm(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:992: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int RangeUnbanTemp(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1027: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int Ban(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1157: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int BanIP(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1204: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int BanNick(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1255: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int TempBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1334: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int TempBanIP(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1383: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int TempBanNick(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1437: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int RangeBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1508: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018int RangeTempBan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1564: error: \u2018lua_tolstring\u2019 was not declared in this scope
/usr/src/PtokaX/src/LuaBanManLib.cpp: In function \u2018void RegBanMan(lua_State*)\u2019:
/usr/src/PtokaX/src/LuaBanManLib.cpp:1642: error: \u2018luaL_register\u2019 was not declared in this scope
make: *** [/usr/src/PtokaX/obj/LuaBanManLib.o] Error 1

Do you maybe have idea what can be problem?

Thanks in advance and best regards
« Last Edit: 31 December, 2008, 20:34:58 by Psycho_Chihuahua »

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 111
  • Karma: +14/-0
  • secret things
    • Metin2 Hungarian Forum
Re: PtokaX Debian/Ubuntu Installer
« Reply #2 on: 12 October, 2008, 23:33:51 »
Check compile.txt and the makefile for compiling instructions. I think you should change -llua5.1 to something else in makefile. Anyway since it's a debian/ubuntu installer don't use it on centOS - compile it manually.

Offline Alexinno

  • Double Ace
  • *
  • Posts: 113
  • Karma: +13/-2
  • -= Hard work makes dreams come true =-
    • IlogicGroup Webserver
Re: PtokaX Debian/Ubuntu Installer
« Reply #3 on: 09 November, 2008, 10:28:36 »
hi guys ,
i have the same problem as kotur above , what do i have to change in makefile ?
if i have this file paths
Code: [Select]
/usr/bin/lua
/usr/bin/luac
/usr/include/lua.h
/usr/include/lua.hpp
/usr/include/luaconf.h
/usr/include/lualib.h
/usr/lib/liblua-5.1.so
/usr/lib/liblua.so
/usr/lib/pkgconfig/lua.pc
/usr/local/bin/lua
/usr/local/bin/luac
/usr/local/include/lua.h
/usr/local/include/lualib.h
/usr/local/lib/liblua.a
/usr/local/lib/liblua_pi.a
/usr/local/lib/liblua_pi.la
/usr/local/lib/liblua_pi.so
/usr/local/lib/liblua_pi.so.0
/usr/local/lib/liblua_pi.so.0.0.0
/usr/local/lib/liblualib.a
/usr/local/lib/lua
/usr/local/lib/lua/5.1
/usr/local/man/man1/lua.1
/usr/local/man/man1/luac.1
/usr/local/share/lua
/usr/local/share/lua/5.1

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 111
  • Karma: +14/-0
  • secret things
    • Metin2 Hungarian Forum
Re: PtokaX Debian/Ubuntu Installer
« Reply #4 on: 09 November, 2008, 15:14:22 »
Quote
#*******************************************************************************
# Binary to create
#
# Lua in Debian is lua5.1. Other known names are lua-5.1, lua51 and lua.
# If you have Lua lib with another name than lua5.1 change it in -llua5.1.
#
# In case when you don't have Lua as dynamic library (in debian liblua5.1.so)
# but as static library (liblua.a default when you compile Lua from sources)
# then remove -llua5.1 and after tinyxml/tinyxml.a add /usr/local/lib/liblua.a (default path when is Lua compiled from sources).
#*******************************************************************************
You can change -llua5.1:
Quote
PtokaX: $(CURDIR)/obj/ClientTagManager.o $(CURDIR)/obj/colUsers.o $(CURDIR)/obj/DcCommands.o $(CURDIR)/obj/DeFlood.o $(CURDIR)/obj/eventqueue.o $(CURDIR)/obj/globalQueue.o $(CURDIR)/obj/hashBanManager.o $(CURDIR)/obj/hashUsrManager.o \
  $(CURDIR)/obj/hashRegManager.o $(CURDIR)/obj/HubCommands.o $(CURDIR)/obj/IP2Country.o $(CURDIR)/obj/LanguageManager.o $(CURDIR)/obj/LuaBanManLib.o $(CURDIR)/obj/LuaCoreLib.o $(CURDIR)/obj/LuaIP2CountryLib.o $(CURDIR)/obj/LuaProfManLib.o \
  $(CURDIR)/obj/LuaRegManLib.o $(CURDIR)/obj/LuaScript.o $(CURDIR)/obj/LuaScriptManager.o $(CURDIR)/obj/LuaScriptManLib.o $(CURDIR)/obj/LuaSetManLib.o $(CURDIR)/obj/LuaTmrManLib.o $(CURDIR)/obj/LuaUDPDbgLib.o $(CURDIR)/obj/ProfileManager.o \
  $(CURDIR)/obj/PtokaX.o $(CURDIR)/obj/pxstring.o $(CURDIR)/obj/RegThread.o $(CURDIR)/obj/ResNickManager.o $(CURDIR)/obj/ServerManager.o $(CURDIR)/obj/ServerThread.o $(CURDIR)/obj/serviceLoop.o $(CURDIR)/obj/SettingManager.o \
  $(CURDIR)/obj/TextFileManager.o $(CURDIR)/obj/UdpDebug.o $(CURDIR)/obj/UDPThread.o $(CURDIR)/obj/User.o $(CURDIR)/obj/utility.o $(CURDIR)/obj/ZlibUtility.o
   $(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \
try -llua-5.1 or something else...
« Last Edit: 09 November, 2008, 15:17:50 by ATAG »

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #5 on: 27 December, 2008, 22:05:46 »
Hello, there is my version of GNU Debian PtokaX 0.4.1.1 installer.
There are all sources in package, simple configs, install & uninstall scripts, rewrited makefile & init.d sctipt for autostart from root.
For install you have to unzip it and start install.sh (This script installs all dependencies, compiles PtokaX, copies files and updates rc.d)
For uninstall - run uninstall.sh - it removes all changes.

It was tested on Debian Etch(4) & Lenny(5-testing), Ubuntu 8.04 & 8.10 and Runtu...

PS Sorry for my poor English. Check it for bugs.
« Last Edit: 27 December, 2008, 22:07:53 by mariner »
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #6 on: 31 December, 2008, 08:01:10 »
I find one erroe - this package didn't create obj folders... So I will do other package 

Make some changes!
« Last Edit: 01 February, 2009, 21:03:54 by mariner »
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #7 on: 04 February, 2009, 17:19:13 »
I make new init.d script for ptokax.
Code: [Select]
#!/bin/sh
# Start/stop/restart the services for PtokaX.
PTOKAXPATH='/etc/ptokax'

ptokax_start() {
echo "Starting PtokaX"
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
/usr/sbin/ptokax -d -c /etc/ptokax
echo "[OK]"
else
echo "DC PtokaX HuB server is already running... Start failed!"
fi
}
ptokax_stop() {
echo "Stoping PtokaX"
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
echo "DC PtokaX HuB server isn't running... Stop failed!"
else
killall -9 ptokax
echo "[OK]"
fi
}
ptokax_restart() {
echo "Restarting PtokaX"
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
/usr/sbin/ptokax -d -c /etc/ptokax
echo "[OK]"
else
killall -9 ptokax
/usr/sbin/ptokax -d -c /etc/ptokax
echo "[OK]"
fi
}
ptokax_status() {
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
echo "No DC PtokaX HuB running..."
else
echo "DC PtokaX HuB server running..."
fi
}

case "$1" in
'start')
ptokax_start
;;
'stop')
ptokax_stop
;;
'status')
ptokax_status
;;
'restart')
ptokax_restart
;;
*)
# Default is "start", for backwards compatibility with previous
echo "start|stop|status|restart"
esac

If you use Debian, you have to install psutils

//EDIT by PPK. Removed all DC++, PtokaX IS NOT DC++ HUB !
« Last Edit: 04 February, 2009, 22:46:06 by PPK »
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: PtokaX Debian/Ubuntu Installer
« Reply #8 on: 04 February, 2009, 19:22:01 »
I don't know anything about Debian but I do have a question regarding the init.

Wouldn't using killall to kill the process prevent it from saving changes to the xml files ?

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: PtokaX Debian/Ubuntu Installer
« Reply #9 on: 04 February, 2009, 22:48:30 »
Afaik killall cause that PtokaX will receive something like terminate signal. That signal is handled by PtokaX and settings should be saved.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: PtokaX Debian/Ubuntu Installer
« Reply #10 on: 05 February, 2009, 09:52:27 »
Isn't -9 equal to SIGKILL?
Everything could have been anything else and it would have just as much meaning.

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: PtokaX Debian/Ubuntu Installer
« Reply #11 on: 05 February, 2009, 12:01:53 »
Afaik killall cause that PtokaX will receive something like terminate signal. That signal is handled by PtokaX and settings should be saved.

Isn't -9 equal to SIGKILL?

Okay thanks for explaining :)

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #12 on: 05 February, 2009, 14:17:46 »
Afaik killall cause that PtokaX will receive something like terminate signal. That signal is handled by PtokaX and settings should be saved.

That's right. I think, you can include init scripts in your package.

PS i can rewrite script (because it kill all PtokaX, it's bad, when you have 2 hubs on server), and make some fixes. In new script, you can restart only one hub.

Code: [Select]

#!/bin/sh
# Start/stop/restart the services for PtokaX.
PTOKAXPATH='/etc/ptokax'

ptokax_start() {
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
/usr/sbin/ptokax -d -c $PTOKAXPATH
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
ANSWER='[FAIL]'
else
ANSWER='[OK]'
fi
echo "Starting PtokaX $ANSWER"
else
echo "DC PtokaX HuB server is already running... Start failed!"
fi
}
ptokax_stop() {
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
echo "DC PtokaX HuB server isn't running... Stop failed!"
else
kill `ps xu | grep "ptokax" | grep "$PTOKAXPATH" | grep -v "grep" | awk '{print $2}'`
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
ANSWER='[OK]'
else
ANSWER='[FAIL]'
fi
echo "Stoping PtokaX $ANSWER"
fi
}
ptokax_restart() {
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
/usr/sbin/ptokax -d -c $PTOKAXPATH
else
kill `ps xu | grep "ptokax" | grep "$PTOKAXPATH" | grep -v "grep" | awk '{print $2}'`
/usr/sbin/ptokax -d -c $PTOKAXPATH
fi
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
ANSWER='[FAIL]'
else
ANSWER='[OK]'
fi
echo "Restarting PtokaX $ANSWER"
}
ptokax_status() {
if [ `ps ax | grep "ptokax -d -c $PTOKAXPATH" | grep -v "grep" | wc -l` = 0 ]; then
echo "No DC PtokaX HuB running..."
else
echo "DC PtokaX HuB server running..."
fi
}

case "$1" in
'start')
ptokax_start
;;
'stop')
ptokax_stop
;;
'status')
ptokax_status
;;
'restart')
ptokax_restart
;;
*)
# Default is "start", for backwards compatibility with previous
echo "start|stop|status|restart"
esac

It think, it will work ;)
« Last Edit: 06 February, 2009, 23:34:32 by mariner »
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #13 on: 10 February, 2009, 23:26:32 »
I make *.deb packages for ubuntu & debian 4 (and 5). I will put them in this topic after all tests.

PS sorry for my poor english.
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #14 on: 15 February, 2009, 01:02:32 »
I can put deb-packages now. In archive you can find 2 deb-files: for ubuntu & debian
You can install, remove & purge this packages.
There are simple hub config in debs & docs in /usr/share/doc/ptokax
Dependencies:
For DEBIAN:
aptitude install liblua5.1-0 liblua5.1-0-dbg liblua5.1-filesystem0 liblua5.1-posix1 liblua5.1-socket2 liblua5.1-sql-sqlite3-2 liblua5.1-xmlrpc0 zlib1g zlib1g-dbg liblua5.1-sql-mysql-2
For UBUNTU:
aptitude install liblua5.1-0 liblua5.1-0-dbg liblua5.1-filesystem0 liblua5.1-posix0 liblua5.1-socket2 liblua5.1-sql-sqlite3-2 liblua5.1-xmlrpc0 zlib1g zlib1g-dbg liblua5.1-sql-mysql-2
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

Offline tony25

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-2
Re: PtokaX Debian/Ubuntu Installer
« Reply #15 on: 10 March, 2009, 20:55:34 »
Hello there. Yesterday I installed PtokaX on my debian server and all went allright apart that inside the tar.gz that I downloaded from http://www.ptokax.org/downloads.html (PtokaX 0.4.1.1 PosiX source (was tested on Linux/FreeBSD) on the tinyxml folder there werent the needed files what in compile.txt says, I mean this files (tinystr.cpp tinystr.h tinyxml.cpp tinyxml.h tinyxmlerror.cpp tinyxmlparser.cpp) anyway I found my self tinyxml source on sourceforge.net and the compile went ok. But when I try to start the hub by typing ./PtokaX it says Starting failed. Any Idea? This is the first time I install ptokax on linux, do I need to setup anything before I start the hub or what? Any sugestion will be fine. Thanks!

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: PtokaX Debian/Ubuntu Installer
« Reply #16 on: 11 March, 2009, 12:52:39 »
Yes, you'll need to create a Settings.xml file in the /cfg folder with at least the HubAddress specified. Ohterwise PtokaX cannot open a listener socket and fails to start. If you're not using the default 411 port, you'll have to specify TCPPorts as well.

Quote
<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
<PtokaX Version="0.4.1.1">
    <Strings>
        <String Name="HubAddress">127.0.0.1</String>
    </Strings>
</PtokaX>

You may also want to create a RegisteredUsers.xml giving yourself an account so you can then modify the rest of the hub settings after login.

Quote
<?xml version="1.0" encoding="windows-1252" standalone="yes" ?>
<RegisteredUsers>
    <RegisteredUser>
        <Nick>CrazyGuy</Nick>
        <Password>1234</Password>
        <Profile>0</Profile>
    </RegisteredUser>
</RegisteredUsers>

Offline tony25

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-2
Re: PtokaX Debian/Ubuntu Installer
« Reply #17 on: 11 March, 2009, 17:05:12 »
Thanks man. But I have another question. If I want to open more than 1 hub, I just have to do the same procedure? I mean install ptokax again create the xml settings files and than start each hub? Thanks

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: PtokaX Debian/Ubuntu Installer
« Reply #18 on: 11 March, 2009, 19:40:49 »
yes, that's it.
When using Windows Service version, you can start multiple instances of the same hubsoft by specifying a different config folder per service. I don't know if the *nix version has this option as well. If so, I wouldn't know how it works as I'm not familiar with *nix.

Offline tony25

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-2
Re: PtokaX Debian/Ubuntu Installer
« Reply #19 on: 11 March, 2009, 23:48:58 »
Thanks for helping man man, I aprisciate :)

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: PtokaX Debian/Ubuntu Installer
« Reply #20 on: 12 March, 2009, 05:02:31 »
I don't know if the *nix version has this option as well.
Of course same option is in *nix version too, working same as on windoze ;)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: PtokaX Debian/Ubuntu Installer
« Reply #21 on: 12 March, 2009, 12:05:06 »
nice :)

PedroNeves

  • Guest
Re: PtokaX Debian/Ubuntu Installer
« Reply #22 on: 12 March, 2009, 16:17:35 »
Ola gostaria de saber se a algu?m se disponibiliza em criar um tutorial para ver se consigo por o ptokax a funcionar no linux (Ubuntu). Era urgente :S e que eu estou a realizar uma lan e queria por isto a correr em linux (Ubuntu) e que ja tentei seguir o que ta no t?pico e nao consigo.

Obrigado fico a aguardar respostas

---------------------------------------------------------------------------------
Hello I would like to know if someone is available to create a tutorial for ptokax to work in linux (Ubuntu).

Thanks I am awaiting answers

Offline tony25

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-2
Re: PtokaX Debian/Ubuntu Installer
« Reply #23 on: 19 March, 2009, 12:47:59 »
Hello guys. It's one thing I dont understand, when I run ptokax then the terminal get blocked, so I can use it anymore till ptokax is shutdown. Sure I can run it using screens, but isnt there any other way?

Offline mariner

  • Member
  • ***
  • Posts: 25
  • Karma: +2/-5
    • [K.lan]Project (now tested)
Re: PtokaX Debian/Ubuntu Installer
« Reply #24 on: 19 March, 2009, 13:31:17 »
use init.d scripts. Example of this script was posted by me ^_^ in this topic later.
Eat my bolts, bastard... ? member of Devaster Squad

sudo ./configure_brain.sh

PtokaX forum

Re: PtokaX Debian/Ubuntu Installer
« Reply #24 on: 19 March, 2009, 13:31:17 »