pomoc s nastavením distcc

Založil marun, 08. 05. 2013, 20:22:49

Předchozí téma - Další téma

marun

snažím se rozjet distcc abych nemusel kompilovat na raspberry pi ale stále mám nějaké problémy
dostal jsem se stavu že když chci skompilovat openTTD a dám ./configure CC="distcc" CXX="distcc" tak mi to detekuje kompilery jako distcc a když dám make -j4 CC="distcc" CXX="distcc" tak mi to napíše error nonblockong connection to 192.168.2.103:3632 failed: connection refused ... warning: failed to distribute (soubor) to 192.168.2.103 running locally instead  a když na raspberry pi restartuju distcc  sudo /etc/init.d/distcc restart tak to píše warning: failed to distribute, running locally instead
nevíte někdo kde by mohl být problém?


raspberry pi - 192.168.2.105
PC - 192.168.2.103
další PC (zatím vypnutý) - 192.168.2.111 (zatím nenakonfigurovaný - až rozjedu ty 2)

tady jsou konfigurační soubory
raspberry pi
/etc/default/distcc
# Defaults for distcc initscript
# sourced by /etc/init.d/distcc

#
# should distcc be started on boot?
#
# STARTDISTCC="true"

STARTDISTCC="true"

#
# Which networks/hosts should be allowed to connect to the daemon?
# You can list multiple hosts/networks separated by spaces.
# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
# Hosts are represented by a single IP Adress
#
# ALLOWEDNETS="127.0.0.1"

ALLOWEDNETS="192.168.2.1 192.168.2.103 192.168.2.105 192.168.2.111"

#
# Which interface should distccd listen on?
# You can specify a single interface, identified by it's IP address, here.
#
# LISTENER="127.0.0.1"

LISTENER="localhost"

#
# You can specify a (positive) nice level for the distcc process here
#
# NICE="10"

NICE="10"

#
# You can specify a maximum number of jobs, the server will accept concurrently
#
# JOBS=""

JOBS=""

#
# Enable Zeroconf support?
# If enabled, distccd will register via mDNS/DNS-SD.
# It can then automatically be found by zeroconf enabled distcc clients
# without the need of a manually configured host list.
#
# ZEROCONF="true"

ZEROCONF="false"


/etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global
# list of available distcc hosts.
#
# The list from this file will only be used, if neither the
# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts
# contains a valid list of hosts.
#
# Add a list of hostnames in one line, seperated by spaces, here.
#+zeroconf

192.168.2.103

192.168.2.111



PC

/etc/default/distcc

STARTDISTCC=true
ALLOWEDNETS="192.168.2.1 192.168.2.105 192.168.2.111"
LISTENER="localhost"
NICE="10"
JOBS=""
ZEROCONF="false"


/etc/distcc/clients.allow

# Comments start with "#" and go to end of line.  Non-comment lines should
# contain entries suitable for passing to the --allow option of distccd, e.g.
#    192.168.1.100
#    192.168.2.0/8
#
# From the distccd man page:
#      -a, --allow IPADDR[/MASK]
#              Instructs  distccd  to  accept  connections  from the IP address
#              IPADDR.  A CIDR mask length can be supplied optionally  after  a
#              trailing  slash,  e.g.  192.168.0.0/24,  in which case addresses
#              that match in the most significant MASK bits  will  be  allowed.
#              If  no  --allow  options are specified, no clients are allowed!
#              Unauthorized connections are rejected by closing the TCP connec-
#              tion immediately.  A warning is logged on the server but nothing
#              is sent to the client.
#
# You should only allow trusted hosts to connect to distccd in TCP mode.
# You should assume that any user on the trusted hosts can (with some
# effort) run arbitrary commands as the distcc user on the distccd host.
# If this is not acceptible, then you should leave this config file empty
# (apart from comments) and thus only allow SSH mode rather than TCP mode.
# However, be aware that SSH mode has poorer performance than TCP mode.

# Add your trusted hosts here, e.g. start by uncommented the line below.
# 127.0.0.1

192.168.2.111



/etc/distcc/commands.allow.sh

#!/bin/sh
# --- /etc/site/current/distcc/commands.allow.sh ----------------------
#
# This file is a shell script that gets sourced by /etc/init.d/distcc.
# It's purpose is to optionally set the following environment
# variables, which affect the behaviour of distccd:
#
#     DISTCC_CMDLIST
#         If the environment variable DISTCC_CMDLIST is set, distccd will
#         load a list of supported commands from the file named by
#         DISTCC_CMDLIST, and will refuse to serve any command whose last
#         DISTCC_CMDLIST_MATCHWORDS last words do not match those of a
#         command in that list.  See the comments in src/serve.c.
#
#     DISTCC_CMDLIST_NUMWORDS
#         The number of words, from the end of the command, to match.  The
#         default is 1.
#
# The interface to this script is as follows.
# Input variables:
#    CMDLIST: this variable will hold the full path of the commands.allow file.
# Side effects:
#    This script should write into the commands.allow file specified by
#    $CMDLIST.  It should write the list of allowable commands, one per line.
# Output variables:
#    DISTCC_CMDLIST and DISTCC_CMDLIST_NUMWORDS. See above.
#-----------------------------------------------------------------------------#

# Here are the parts that you may want to modify.

numwords=1
allowed_compilers="
  /home/martin/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-c++
  /home/martin/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-cpp
  /home/martin/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
  /home/martin/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc

"

# You shouldn't need to alter anything below here.

[ "$CMDLIST" ] || {
   echo "$0: don't run this script directly!" >&2
   echo "Run /etc/init.d/distcc (or equivalent) instead." >&2
   exit 1
}

echo $allowed_compilers | tr ' ' '\n' > $CMDLIST
DISTCC_CMDLIST=$CMDLIST
DISTCC_CMDLIST_NUMWORDS=$numwords



/etc/distcc/hosts

# As described in the distcc manpage, this file can be used for a global
# list of available distcc hosts.
#
# The list from this file will only be used, if neither the
# environment variable DISTCC_HOSTS, nor the file $HOME/.distcc/hosts
# contains a valid list of hosts.
#
# Add a list of hostnames in one line, seperated by spaces, here.
#+zeroconf

localhost

192.168.2.111


Palo M.

LISTENER="localhost" bude zjavne tvoj problem (pravdepodobne pocuva len na loopbacku, nie na sietovom adapteri).
Over si cez netstat ("netstat -46anp"), kde v skutocnosti pocuva. Ak len na loopbacku (127.0.0.1, pripadne len na ::1), tak to zmen na:
LISTENER="0.0.0.0" (= pocuvaj na vsetkych interfacoch) a restartni distcc.

To "connection refused" moze znamenat aj to, ze ti to odmieta firewall (pripadne treba skontrolovat aj /etc/hosts.deny a /etc/hosts.allow), takze ak by ti to stale nechodilo, prekontroluj aj tieto veci.

marun

#2
přenastavil jsem všechny LISTENER na 0.0.0.0 a když restartuju oba distcc přes /etc/init.d/distcc restart tak to napíše ERROR: compile ... no 192.168.2.103 failed
(dcc_build_somewhere) warning: remote compilation of ... failed, retrying locally
warning: failed to distribute ... to 192.168.2.103 running locally instead


toolchainem to být nemůže jedině že by ho nechápal distcc protoze jsem pomocí něj skompiloval jednoduchý prográmek a funguje

Palo M.

Takto od stola ti konkretne neporadim (s cross-kompilatorom to predsa len je trocha nestandardne), iba nejake vseobecne tipy:

- Pozri do logu (na tom PC) - ci tam vidis pokus o spojenie, ci negeneruje nejake chyby. V pripade potreby docasne zapni detailnejsi level logovania distccd.

- Myslim, ze distcc vyzaduje, aby sa kompilator vsade volal rovnako (na masine kde ho spustas aj na masine, kde sa kompiluje). Je dost mozne, ze na RaspberryPi sa kompilator vola jednoducho len standardne "gcc", ale na build-stroji sa vola "arm-linux-gnueabihf-gcc" - distccd vtedy skusa spustit gcc, ktore ale nie je povolene... V tom pripade by si mal kompilaciu robit tak, aby si zabezpecil rovnake meno: na RaspberryPi spravis symbolicky link arm-linux-gnueabihf-gcc, ktory bude smerovat na binarku distcc a make potom spustis s CC="arm-linux-gnueabihf-gcc". Cez ten symbolicky link sa samozrejme spusti distcc, ale bude vediet, ze bol spusteny pod inym menom (arm-linux-gnueabihf-gcc) a preto aj na vzdialenom build-stroji bude spustat priamo tento kompilator.

- Inak ten distccd nemusis vobec spustat na tom RaspberryPi (staci na buildovacich strojoch). A vlastne by si nemusel distccd spustat vobec, ak by si isiel cez ssh (vid man distcc a man distccd), pretoze v takom pripade sa spusta on-demand (podobne ako napriklad rsync) a je to aj bezpecnejsie. Ale na domacej sieti sa ti mozno viac hodi ist na priamo (ak vies, ze tvoja siet je bezpecna), pretoze ten ssh tunel si samozrejme zoberie nejaku tu reziu...

marun

#4
tady je ten log

distccd[15231] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[15373] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[15504] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[16992] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[2254] (dcc_execvp) ERROR: failed to exec g++: No such file or directory
distccd[1078] (dcc_job_summary) client: 192.168.2.111:50854 COMPILE_ERROR exit:110 sig:0 core:0 ret:0 time:17ms g++ /home/martin/openttd-1.3.0/src/settingsgen/settingsgen.cpp
distccd[1077] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[2862] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[1102] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[2391] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4317] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4539] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4565] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4611] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4667] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4695] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4784] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[4829] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[2294] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[1055] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[1076] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[2738] (dcc_job_summary) client: 192.168.2.105:33074 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:2526ms cc /home/pi/openttd-1.3.0/src/road_map.cpp
distccd[2743] (dcc_job_summary) client: 192.168.2.105:33075 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3450ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[2744] (dcc_job_summary) client: 192.168.2.105:33076 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:4137ms cc /home/pi/openttd-1.3.0/src/roadstop.cpp
distccd[2745] (dcc_readx) ERROR: unexpected eof on fd5
distccd[2745] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[2745] (dcc_job_summary) client: 192.168.2.105:33077 OTHER exit:0 sig:0 core:0 ret:108 time:4366ms
distccd[2747] (dcc_job_summary) client: 192.168.2.105:33079 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:1967ms cc /home/pi/openttd-1.3.0/src/road_map.cpp
distccd[2746] (dcc_job_summary) client: 192.168.2.105:33078 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3400ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[2743] (dcc_job_summary) client: 192.168.2.105:33081 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3354ms cc /home/pi/openttd-1.3.0/src/roadstop.cpp
distccd[2738] (dcc_readx) ERROR: unexpected eof on fd5
distccd[2738] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[2738] (dcc_job_summary) client: 192.168.2.105:33080 OTHER exit:0 sig:0 core:0 ret:108 time:4105ms
distccd[2737] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[3209] (dcc_job_summary) client: 192.168.2.105:33085 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:2115ms cc /home/pi/openttd-1.3.0/src/road_map.cpp
distccd[3204] (dcc_job_summary) client: 192.168.2.105:33083 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3339ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3210] (dcc_job_summary) client: 192.168.2.105:33084 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3396ms cc /home/pi/openttd-1.3.0/src/roadstop.cpp
distccd[3211] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3211] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3211] (dcc_job_summary) client: 192.168.2.105:33086 OTHER exit:0 sig:0 core:0 ret:108 time:3588ms
distccd[3203] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[3235] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[3267] (dcc_job_summary) client: 192.168.2.105:33088 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:2325ms cc /home/pi/openttd-1.3.0/src/road_map.cpp
distccd[3262] (dcc_job_summary) client: 192.168.2.105:33087 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3784ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3268] (dcc_job_summary) client: 192.168.2.105:33089 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:3746ms cc /home/pi/openttd-1.3.0/src/roadstop.cpp
distccd[3269] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3269] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3269] (dcc_job_summary) client: 192.168.2.105:33090 OTHER exit:0 sig:0 core:0 ret:108 time:5446ms
distccd[3270] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3270] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3270] (dcc_job_summary) client: 192.168.2.105:33092 OTHER exit:0 sig:0 core:0 ret:108 time:0ms
distccd[3271] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3271] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3271] (dcc_job_summary) client: 192.168.2.105:33091 OTHER exit:0 sig:0 core:0 ret:108 time:0ms
distccd[3267] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3267] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3267] (dcc_job_summary) client: 192.168.2.105:33093 OTHER exit:0 sig:0 core:0 ret:108 time:0ms
distccd[3262] (dcc_readx) ERROR: unexpected eof on fd5
distccd[3262] (dcc_r_token_int) ERROR: read failed while waiting for token "DOTI"
distccd[3262] (dcc_job_summary) client: 192.168.2.105:33094 OTHER exit:0 sig:0 core:0 ret:108 time:0ms
distccd[3268] (dcc_job_summary) client: 192.168.2.105:33095 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:952ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3269] (dcc_job_summary) client: 192.168.2.105:51451 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:1009ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3261] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[1235] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[1078] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[3605] (dcc_job_summary) client: 192.168.2.105:56228 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:1464ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3610] (dcc_job_summary) client: 192.168.2.105:56229 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:1004ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp
distccd[3604] (dcc_remove_pid) Warning: failed to remove pid file /var/run/distccd.pid: Permission denied
distccd[3804] (dcc_job_summary) client: 192.168.2.105:56231 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:1106ms cc /home/pi/openttd-1.3.0/src/road_gui.cpp

zkoušel jsem ten symlink ale nejsem si jistý jak ho správně napsat zkusil sem to takto
cd /usr/local/bin
ln -s distcc arm-linux-gnueabihf-gcc

a pak sem to tam vložil místo toho
make CC="arm-linux-ghueabihf-gcc" ...
ale to psalo failed to distribute

a jak si to myslel s tou kompilací přes ssh?


VYŘEŠENO! udělal jsem tzv MASQUERADING - udělal sem si složku kam sem naházel symlinky na ten toolchain, a tuto cestu sem zadal do /etc/init.d/distcc do PATH jako první a odstranil sem cestu k původnímu compileru a už to jede na malině už stačí jen ./configure CC=distcc CXX=distcc a make

mám další problém chtěl jsem si to překompilovat znovu celé ať vidím jak to bude rychlé a teď mi sice distcc píše kompilaci OK ale na malině vyskákaly chyby při kompilování a linkování jednoho souboru a dál se to zaseklo
make[1]: Entering directory `/home/pi/openttd-1.3.0/objs/lang'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pi/openttd-1.3.0/objs/lang'
make[1]: Entering directory `/home/pi/openttd-1.3.0/objs/setting'
[SETTING] Compiling and Linking settings_gen
ini_load.o: In function `IniItem::~IniItem()':
ini_load.cpp:(.text+0x8c): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniGroup::~IniGroup()':
ini_load.cpp:(.text+0x1cc): undefined reference to `operator delete(void*)'
ini_load.cpp:(.text+0x1e8): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniLoadFile::~IniLoadFile()':
ini_load.cpp:(.text+0x224): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniLoadFile::~IniLoadFile()':
ini_load.cpp:(.text+0x244): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniGroup::GetItem(char const*, bool)':
ini_load.cpp:(.text+0x29c): undefined reference to `operator new(unsigned int)'
ini_load.o: In function `IniGroup::Clear()':
ini_load.cpp:(.text+0x2ec): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniLoadFile::GetGroup(char const*, unsigned int, bool)':
ini_load.cpp:(.text+0x3a4): undefined reference to `operator new(unsigned int)'
ini_load.o: In function `IniLoadFile::RemoveGroup(char const*)':
ini_load.cpp:(.text+0x490): undefined reference to `operator delete(void*)'
ini_load.o: In function `IniLoadFile::LoadFromDisk(char const*, Subdirectory)':
ini_load.cpp:(.text+0x628): undefined reference to `operator new(unsigned int)'
ini_load.cpp:(.text+0x678): undefined reference to `operator new(unsigned int)'
ini_load.cpp:(.text+0x73c): undefined reference to `operator new(unsigned int)'
ini_load.o:(.rodata+0x10): undefined reference to `__cxa_pure_virtual'
ini_load.o:(.rodata+0x14): undefined reference to `__cxa_pure_virtual'
ini_load.o:(.rodata+0x28): undefined reference to `vtable for __cxxabiv1::__class_type_info'
settingsgen.o: In function `main':
settingsgen.cpp:(.text+0x6e8): undefined reference to `__cxa_guard_acquire'
settingsgen.cpp:(.text+0x708): undefined reference to `__cxa_guard_release'
settingsgen.cpp:(.text+0x710): undefined reference to `operator new(unsigned int)'
settingsgen.cpp:(.text+0x760): undefined reference to `operator delete(void*)'
settingsgen.cpp:(.text+0x764): undefined reference to `__cxa_end_cleanup'
settingsgen.cpp:(.text+0x76c): undefined reference to `__cxa_guard_acquire'
settingsgen.cpp:(.text+0x79c): undefined reference to `__cxa_guard_release'
settingsgen.o:(.ARM.extab+0x28): undefined reference to `__gxx_personality_v0'
settingsgen.o: In function `SettingsIniFile::~SettingsIniFile()':
settingsgen.cpp:(.text._ZN15SettingsIniFileD0Ev[SettingsIniFile::~SettingsIniFile()]+0x18): undefined reference to `operator delete(void*)'
settingsgen.o:(.rodata._ZTI15SettingsIniFile[typeinfo for SettingsIniFile]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: ld returned 1 exit status
distcc[8537] ERROR: compile (null) on localhost failed
make[1]: *** [settings_gen] Error 1
make[1]: Leaving directory `/home/pi/openttd-1.3.0/objs/setting'
make: *** [all] Error 1


předtím to proběhlo v pohodě