Re: [Lazarus] systemd
Le 27/06/2015 13:47, A. Fortuny a écrit : Hi Folks. Currently I have some services running in a linux box (OpenSuse 11.2) and they will be moved to an OpenSuse 13.2. I want to move the services from SysV to systemd. I noticed that in the service configuration file (namely /usr/lin/systemd/system/MyService.service) there are some options wich bother me a little bit. The services are programs written using Lazarus and its service framework. Please note that the services run either on Windows or on Linux (some $ifdef help). I wonder what happens on two points: 1. the new service type parameter TYPE in section [Service] should be simple I guess 2. the parameter TimeoutStartSec bothers me. As in the sefvice framework developed using Lazarus units (service project), the program is started by the INIT script in /etc/init.d with the -r runtime switch. The program then responds to the start event of the Daemon unit wich, in turn, starts the main thread and the called start procedure exits as soon as posible. The program keeps running until the exit signal is fired and the main thread is stopped. If it is by the means of the INIT script (service MyService stop) the process is killed either soft or hard. The question is: does a service written in this new method still needs the Lazarus service framework ? What is the signal sent to systemd wich informs it that the sevice has started (read man systemd.service (5) )? The same mechanism as the Lazarus service framework still applies ? I'm not yet ready to use either D-BUS messaging system nor socket based systemd start service mechanism. Thank you for any information. Antonio. Hi All. After a reading thru all documentation spread over there I succeeded to port an Initd service to the new systemd.. Both questions above got their answer: 1. simple is the right type 2. I didn't enven specify avy time out. The most important lesson learned is that the service program written using Lazarus and Fpc does not require ANY change. It woks as is provided that the launch command includes the -r parameter. systemctl enable MyService: OK systemctl start MyService: OK systemctl stop MyService: OK Service file in /etc/systemd/system with minimal options reboot the linux box and the service has been properly stopped and restarted after booting again. Nice and clear, thanks to all Antonio. --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] systemd
Hi Folks. Currently I have some services running in a linux box (OpenSuse 11.2) and they will be moved to an OpenSuse 13.2. I want to move the services from SysV to systemd. I noticed that in the service configuration file (namely /usr/lin/systemd/system/MyService.service) there are some options wich bother me a little bit. The services are programs written using Lazarus and its service framework. Please note that the services run either on Windows or on Linux (some $ifdef help). I wonder what happens on two points: 1. the new service type parameter TYPE in section [Service] should be simple I guess 2. the parameter TimeoutStartSec bothers me. As in the sefvice framework developed using Lazarus units (service project), the program is started by the INIT script in /etc/init.d with the -r runtime switch. The program then responds to the start event of the Daemon unit wich, in turn, starts the main thread and the called start procedure exits as soon as posible. The program keeps running until the exit signal is fired and the main thread is stopped. If it is by the means of the INIT script (service MyService stop) the process is killed either soft or hard. The question is: does a service written in this new method still needs the Lazarus service framework ? What is the signal sent to systemd wich informs it that the sevice has started (read man systemd.service (5) )? The same mechanism as the Lazarus service framework still applies ? I'm not yet ready to use either D-BUS messaging system nor socket based systemd start service mechanism. Thank you for any information. Antonio. --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] systemd
Le 27/06/2015 14:31, Luca Olivetti a écrit : El 27/06/15 a les 13:47, A. Fortuny ha escrit: Hi Folks. Currently I have some services running in a linux box (OpenSuse 11.2) and they will be moved to an OpenSuse 13.2. I want to move the services from SysV to systemd. Did you see this? http://wiki.freepascal.org/Daemons_and_Services#Linux_.28Fedora.29 No but tons of similar pages on linus systemd architecture. But none give an answer to my questions but indirectly The service configuration file on the wiki paghe suggests thar the service program (because of the -r swith) uses the Lazarus service framework TimeourSec is mentioned but without explanation. I gonna run a try one of those days. Thanks anyway. Bye --- L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast. https://www.avast.com/antivirus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] systemd
El 27/06/15 a les 13:47, A. Fortuny ha escrit: Hi Folks. Currently I have some services running in a linux box (OpenSuse 11.2) and they will be moved to an OpenSuse 13.2. I want to move the services from SysV to systemd. Did you see this? http://wiki.freepascal.org/Daemons_and_Services#Linux_.28Fedora.29 Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus