[Lazarus] Linux service

2013-11-27 Thread Antonio Fortuny
Hi Folks. I have created a service which has to run into Windows and Linux servers. The program runs OK on both OS and the service runs nicely in Windows (32 and 64). I'm only a little bit stuck onto an UBUNTU platform. I've managed to launch and stop the service on an OpenSuse platform

Re: [Lazarus] Linux service

2013-11-27 Thread Michael Van Canneyt
On Wed, 27 Nov 2013, Antonio Fortuny wrote: Hi Folks. I have created a service which has to run into Windows and Linux servers. The program runs OK on both OS and the service runs nicely in Windows (32 and 64). I'm only a little bit stuck onto an UBUNTU platform. I've managed to launch

Re: [Lazarus] Linux service

2013-11-27 Thread Michael Van Canneyt
On Wed, 27 Nov 2013, Patrick Chevalley wrote: Hi, To enable your program to react to signal you need to use fpSigAction. See here for usage: http://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html Instead of SigUsr1 in the example you can register a procedure for SIGTerm to

Re: [Lazarus] Linux service

2013-11-27 Thread Antonio Fortuny
Le 27/11/2013 15:06, Michael Van Canneyt a écrit : On Wed, 27 Nov 2013, Patrick Chevalley wrote: Hi, To enable your program to react to signal you need to use fpSigAction. See here for usage: http://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html Instead of SigUsr1 in the

Re: [Lazarus] Linux service

2013-03-19 Thread Antonio Fortuny
I finally succeded to manage the service. The basic developmment done in WIN32 has been preserved. I've now a unique source project compiling and running on WIN32 and LINUX. So far, so good. There is only one thing which worries me: when stopping the service (aka service ipserviced stop) the

Re: [Lazarus] Linux service

2013-03-19 Thread Antonio Fortuny
Le 19/03/2013 16:52, Antonio Fortuny a écrit : I finally succeded to manage the service. The basic developmment done in WIN32 has been preserved. I've now a unique source project compiling and running on WIN32 and LINUX. So far, so good. There is only one thing which worries me: when stopping

Re: [Lazarus] Linux service

2013-03-19 Thread Michael Van Canneyt
On Tue, 19 Mar 2013, Antonio Fortuny wrote: Le 19/03/2013 16:52, Antonio Fortuny a écrit : I finally succeded to manage the service. The basic developmment done in WIN32 has been preserved. I've now a unique source project compiling and running on WIN32 and LINUX. So far, so good. There is

[Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
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

Re: [Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
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 Same behaviour, got a /tmp/start-man.log and start.log (very similar) 3983

Re: [Lazarus] Linux service

2013-03-15 Thread Michael Van Canneyt
On Fri, 15 Mar 2013, Antonio Fortuny wrote: 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 Same behaviour, got a

Re: [Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
- the process is started and writes to the system log. You should see what happens in /var/log/syslog. /var/log/messages: Mar 15 11:14:29 linux-5yg5 ipservice: [Info] Daemon Sita - Pocket service current status: Start Pending Mar 15 11:14:29 linux-5yg5 ipservice: [Info] Failed to start daemon

Re: [Lazarus] Linux service

2013-03-15 Thread Michael Van Canneyt
On Fri, 15 Mar 2013, Antonio Fortuny wrote: - the process is started and writes to the system log. You should see what happens in /var/log/syslog. /var/log/messages: Mar 15 11:14:29 linux-5yg5 ipservice: [Info] Daemon Sita - Pocket service current status: Start Pending Mar 15 11:14:29

Re: [Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
Le 15/03/2013 12:42, Michael Van Canneyt a écrit : On Fri, 15 Mar 2013, Antonio Fortuny wrote: - the process is started and writes to the system log. You should see what happens in /var/log/syslog. /var/log/messages: Mar 15 11:14:29 linux-5yg5 ipservice: [Info] Daemon Sita - Pocket

Re: [Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
The project source is in the attached tarball Antonio test.tar Description: Unix tar archive -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Re: [Lazarus] Linux service

2013-03-15 Thread Michael Van Canneyt
On Fri, 15 Mar 2013, Antonio Fortuny wrote: Le 15/03/2013 12:42, Michael Van Canneyt a écrit : On Fri, 15 Mar 2013, Antonio Fortuny wrote: - the process is started and writes to the system log. You should see what happens in /var/log/syslog. /var/log/messages: Mar 15 11:14:29

Re: [Lazarus] Linux service

2013-03-15 Thread Antonio Fortuny
Le 15/03/2013 13:48, Michael Van Canneyt a écrit : To your program's uses clause ? yes, all units refering to threads Did you define UseCThreads ? It is not automatically defined. yep; Added -dUseCThreads to Other of project options same behaviour and same messages in /var/log/messages