Answer the question
In order to leave comments, you need to log in
How to create your own daemon in centos 7 on lua?
Good afternoon.
There is a lua script that connects to the server and in a loop, while there is a connection, it waits for an event and already does the necessary processing.
Approximately like this
#!/usr/local/bin/lua
local con = Connetct(url, login, pass);
if con:connected() then
#обработка
end
[Unit]
Description=lvCallCenter
After=mysql.service
Requires=mysql.service
[Service]
Type=forking
PIDFile=pid
WorkingDirectory=dir
User=leadvertex
Group=leadvertex
Environment=RACK_ENV=production
OOMScoreAdjust=-1000
ExecStart=/usr/local/bin/lua script.lua
Restart=always
TimeoutSec=300
[Install]
WantedBy=multi-user.target
Answer the question
In order to leave comments, you need to log in
You have "Type=forking" specified, which is used for services that start themselves in the background. Your script does not. So remove "Type=forking", or replace it with the default value "Type=simple".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question