Recent

Author Topic: Stop service by the daemon's own executable.  (Read 876 times)

andersonscinfo

  • Full Member
  • ***
  • Posts: 132
Stop service by the daemon's own executable.
« on: April 21, 2021, 05:44:13 pm »
I don't know if the title was clear enough, but I will try to explain it better now, I have a service (daemon) and then I would like to stop or pause this service, but I want to do this for them myself, I tried to add a SimpleIPCServer and send a message, but it doesn’t work, has anyone been through this and could help me?

Att.

Thaddy

  • Hero Member
  • *****
  • Posts: 14165
  • Probably until I exterminate Putin.
Re: Stop service by the daemon's own executable.
« Reply #1 on: April 21, 2021, 06:01:25 pm »
Actually, the provided example does what you need.
Note the Daemon itself needs a controller, because it has no GUI interaction.
See packages/fcl-extra/examples

If that is not what you mean, you CAN make a daemon (or service in Windows speak) terminate itself based on a certain condition or timer, but it is not clear to me what you mean.
« Last Edit: April 21, 2021, 06:07:19 pm by Thaddy »
Specialize a type, not a var.

andersonscinfo

  • Full Member
  • ***
  • Posts: 132
Re: Stop service by the daemon's own executable.
« Reply #2 on: April 21, 2021, 07:40:43 pm »
I will try to explain better, I want to interact with the service, but not through the windows control, I want to interact through my application, so I tried to use the simpleipcserver, I will set up an example, to try to explain better.

andersonscinfo

  • Full Member
  • ***
  • Posts: 132
Re: Stop service by the daemon's own executable.
« Reply #3 on: April 21, 2021, 08:14:49 pm »
Here is an example of what I’m trying to do, I believe it’s easier to understand.

Att.

cdbc

  • Hero Member
  • *****
  • Posts: 995
    • http://www.cdbc.dk
Re: Stop service by the daemon's own executable.
« Reply #4 on: April 21, 2021, 11:56:50 pm »
hi
You could setup a tcp server in your daemon and just communicate with that. I think Synapse would be a good choice, not much overhead...
Have a look at the Echo example...
just my 2 cents
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

andersonscinfo

  • Full Member
  • ***
  • Posts: 132
Re: Stop service by the daemon's own executable.
« Reply #5 on: April 22, 2021, 12:21:36 am »
and tested it, but httpaplication can't stop daemonapplication.

Att.

 

TinyPortal © 2005-2018