[Lazarus] Linux service

Michael Van Canneyt michael at freepascal.org
Fri Mar 15 10:58:23 CET 2013



On Fri, 15 Mar 2013, Antonio Fortuny wrote:

> Hi Folks.
>
> I've a problem when launching a service in a Linuxbox (OpenSuse 12.1, VM 
> under esxi).
> The service program has been first developped in Win32. It is installed 
> without problem, then ran and stopped and finally uninstalled. All functions 
> run well as I get the events into the log file
> Then port on Linux, compile OK. Just adapt the log file name
> I've made a script based on the smb one. The service is called ipserviced the 
> program itself /usr/local/bin/ipservice
> chkconfig'ed --add, --list, --level all run well. S01Servicename and 
> corresponding K01... have been created into corresponding  rc?.d folders
> So far, so good. But wen launching:
> # service ipserviced start
> Starting IpService daemon (is displayed by service launcher)
> shell is hung, some process is lanched, see:
> root      2420 12428  0 10:10 pts/3    00:00:00 /bin/sh /sbin/service 
> ipserviced start
> root      2422  2420  0 10:10 pts/3    00:00:00 /bin/sh 
> /etc/init.d/ipserviced start
> root      2430  2422  0 10:10 pts/3    00:00:01 startproc -p /var/run/ipservice/ipservice.pid -W /var/run/ipservice/ipservice.pid  /usr/local/bin/ipservice -r -D -s /usr/local/bin/ipservice.conf

1. Change this to use strace:

startproc -p /var/run/ipservice/ipservice.pid -W /var/run/ipservice/ipservice.pid  strace -f -o /tmp/start.log /usr/local/bin/ipservice -r -D -s /usr/local/bin/ipservice.conf

in /tmp/start.log you'll then see what the process is doing.

2. Try starting the process manually
strace -f -o /tmp/start-man.log /usr/local/bin/ipservice -r -D -s /usr/local/bin/ipservice.conf

and see if there is a difference.

Michael.




More information about the Lazarus mailing list