maniac103 / ems-collector

Buderus EMS heating control data collection daemon
GNU General Public License v3.0
28 stars 10 forks source link

Need a hint: Why can't I copy collectord to another machine from same OS on same arch and execute? #26

Closed bgewehr closed 4 years ago

bgewehr commented 4 years ago

When I copy collectord to a new debian 9 container (it was compiled in another one of the same image on the same machine), it does not execute, saying file not found:

root@collectord1:/usr/local/sbin# ls -l                                                                                        
total 800                                                                                                                      
-rwxr-xr-x 1 root root 817512 Jan  3 11:02 collectord                                                                          
root@collectord1:/usr/local/sbin# collectord                                                                                   
bash: /usr/local/sbin/collectord: No such file or directory                                                                    
maniac103 commented 4 years ago

No idea OTOH, but running strace -f /usr/local/sbin/collectord may give a hint?

bgewehr commented 4 years ago

Does this explain to you what happens?

root@collectord1:/# strace -f /usr/local/sbin/collectord                                                                       
execve("/usr/local/sbin/collectord", ["/usr/local/sbin/collectord"], [/* 7 vars */]) = -1 ENOENT (No such file or directory)   
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0                                                             
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory                                      
) = 40                                                                                                                         
getpid()                                = 255                                                                                  
exit_group(1)                           = ?                                                                                    
+++ exited with 1 +++                                                                                                          
root@collectord1:/# /mnt/ems/collectord                                                                                        
bash: /mnt/ems/collectord: No such file or directory                                                                           
bgewehr commented 4 years ago

I tried to execute /mnt/ems/collectord on both containers. Only the one where it was built runs the file correctly:

root@i386-debian1:/# /mnt/ems/collectord                                                                                       
Usage: /mnt/ems/collectord [options] <target>                                                                                  

Possible values for target:                                                                                                    
  serial:<device>     Connect to serial device <device> without sending support (e.g. Atmega8)                                 
  tx-serial:<device>  Connect to serial device <device> with sending support (e.g. EMS Gateway)                                
  tcp:<host>:<port>   Connect to TCP address <host> at <port> (e.g. NetIO)                                                     

General options:                                                                                                               
  -h [ --help ]                         Show this help message                                                                 
  -R [ --rc-type ] arg                  Type of used room controller (rc30 or                                                  
                                        rc35)                                                                                  
  -r [ --ratelimit ] arg (=60)          Rate limit (in s) for writing numeric                                                  
                                        sensor valuesB                                                                         
  -d [ --debug ] arg (=none)       into D      Comma separated list of debug flags                                             
                                        (all, io, message, data, stats, no  ne)                                                
                                      anles,d their fi.g e.                                                                    
                                        message=/tmp/messages.txt 
...

The pid /var/run/ems-collector.pid file exists on both, so does the /etc/default/ems-collector conf file.

bgewehr commented 4 years ago

OK. All my fault. Wrong image source refered to, wrong arch was taken. now, i386 arc, all good.

BUT: What is the smallest way of providing all necessary so libraries from boost?

root@collectord2:/# collectord                                                                                                 
collectord: error while loading shared libraries: libboost_system.so.1.62.0: cannot open shared object file: No such file or di
rectory 
bgewehr commented 4 years ago

Found that it is enough to install

apt-get install libboost-system1.62.0
apt-get install libboost-program-options1.62.0

Now it's working as expected. Sorry for being dumb.