Hi,
with the help of the wiki and this (quite old) discussion
https://forum.lazarus.freepascal.org/index.php/topic,20274.0.html, I successfully wrote some windows services, and they work as expected;
as a base of developing I used the approach by Udo Schmal here,
https://www.gocher.me/Daemon in which he sets the FreeOnTerminate property of the thread to true when he starts the service;
when the service is started, I usually check for the existence of a config file from which I retrieve a handful of settings to be used in the execution;
as of today, if the config file does not exist I just don't go on and terminate the thread, but a thing I thought it was easy to do, that I've been not able to (and would like), is to "stop" (automatically) the service if this condition is met; probably I'm missing something..
if I'm not getting confused, I saw more than one time an "example" of what I'm saying, of a windows service that once started (by pressing "start" or with "net start servicename") automatically stops (for some reason, obviously), how could I reproduce this behavior?
Do you think it's possible?