How to create a daemon in centos 7 in lua?

Good afternoon.
There is a lua script, which connects to the server in a loop until the connection is waiting for the event and is already doing the necessary processing.
Something like this

local con = Connetct(url, login, pass);

if con:connected() then

In order to run this script as a daemon using systemd. Was this config





ExecStart=/usr/local/bin/lua script.lua


Run it a bit wrong, as we would like, i.e. after you run the command systemctl start myunit nothing happens, no output, all start and you have to press ctrl+c to cancel.
But the demon appears in the processes and everything works.

But I would like to do to it is normally run.
Most likely the problem is in the output streams, I tried to not override did not help. Also I think that the lua script somehow should answer systemd that it has started and is running.
Please help to resolve this issue. Thank you in advance for your help.
July 2nd 19 at 17:03
2 answers
July 2nd 19 at 17:05
You have specified "Type=forking", which is used for services, which themselves run in the background. Your script does not. So remove the "Type=forking", or replace it with a default value of "Type=simple".
Thanks for help - Fred_Durg commented on July 2nd 19 at 17:08
July 2nd 19 at 17:07
Not an expert in systemd and tembolee in lua. But "launch daemons" I've always helped such a crutch as a screen :)
you can of course through the screen, but it still spike - Fred_Durg commented on July 2nd 19 at 17:10

Find more questions by tags CentOSLinuxLua