[Lazarus] systemd

A. Fortuny aforsprl at gmail.com
Fri Jul 10 13:09:46 CEST 2015


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






More information about the Lazarus mailing list