systemd rqworker service












1















Systemd service, I want to create but it fails.
This is my service i have created.



[Unit]
Description=rqworker daemon
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/mamster
User=ubuntu
Group=ubuntu
#EnvironmentFile=/etc/sysconfig/master.env
#Environment="PYTHONPATH=/home/ubuntu/venv"
ExecStart=/home/ubuntu/venv /venv/bin/rqworker master
StandardOutput=/home/ubuntu/logs/icengine/std_out.log
StandardError=/home/ubuntu/logs/icengine/std_err/log
#SyslogIdentifier=icengin
KillMode=process
Restart=always
TimeoutSec=infinity
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=master.service


Initially this service is Actiating(Start) but was not Active



But after i made some changes and now it showing error:



After running sudo systemctl start rq



(venv) ubuntu@ubuntucalc:~$ sudo systemctl status rq
● rq.service - rqworker daemon
Loaded: loaded (/etc/systemd/system/rq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-15 06:53:20 UTC; 4s ago
Process: 18537 ExecStart=/home/ubuntu/venv /venv/bin/rqworker master (code=exited, status=200/CHDIR)
Main PID: 18537 (code=exited, status=200/CHDIR)

Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Main process exited, code=exited, status=200/CHDIR
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Service hold-off time over, scheduling restart.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Scheduled restart job, restart counter is at 5.
Jan 15 06:53:20 ubuntucalc systemd[1]: Stopped rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Start request repeated too quickly.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.


This is the output i have got.
Thanks










share|improve this question

























  • What does the std_out / std_err logs say ?

    – Soren A
    Jan 15 at 7:32











  • @SorenA well this makes it more complicate. Even logs are also not recording.

    – Rajat jain
    Jan 15 at 8:19











  • You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

    – PerlDuck
    Jan 15 at 8:55








  • 1





    wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

    – Rajat jain
    Jan 15 at 9:11











  • But still my Logs not generate!!!

    – Rajat jain
    Jan 15 at 9:13
















1















Systemd service, I want to create but it fails.
This is my service i have created.



[Unit]
Description=rqworker daemon
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/mamster
User=ubuntu
Group=ubuntu
#EnvironmentFile=/etc/sysconfig/master.env
#Environment="PYTHONPATH=/home/ubuntu/venv"
ExecStart=/home/ubuntu/venv /venv/bin/rqworker master
StandardOutput=/home/ubuntu/logs/icengine/std_out.log
StandardError=/home/ubuntu/logs/icengine/std_err/log
#SyslogIdentifier=icengin
KillMode=process
Restart=always
TimeoutSec=infinity
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=master.service


Initially this service is Actiating(Start) but was not Active



But after i made some changes and now it showing error:



After running sudo systemctl start rq



(venv) ubuntu@ubuntucalc:~$ sudo systemctl status rq
● rq.service - rqworker daemon
Loaded: loaded (/etc/systemd/system/rq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-15 06:53:20 UTC; 4s ago
Process: 18537 ExecStart=/home/ubuntu/venv /venv/bin/rqworker master (code=exited, status=200/CHDIR)
Main PID: 18537 (code=exited, status=200/CHDIR)

Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Main process exited, code=exited, status=200/CHDIR
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Service hold-off time over, scheduling restart.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Scheduled restart job, restart counter is at 5.
Jan 15 06:53:20 ubuntucalc systemd[1]: Stopped rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Start request repeated too quickly.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.


This is the output i have got.
Thanks










share|improve this question

























  • What does the std_out / std_err logs say ?

    – Soren A
    Jan 15 at 7:32











  • @SorenA well this makes it more complicate. Even logs are also not recording.

    – Rajat jain
    Jan 15 at 8:19











  • You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

    – PerlDuck
    Jan 15 at 8:55








  • 1





    wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

    – Rajat jain
    Jan 15 at 9:11











  • But still my Logs not generate!!!

    – Rajat jain
    Jan 15 at 9:13














1












1








1








Systemd service, I want to create but it fails.
This is my service i have created.



[Unit]
Description=rqworker daemon
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/mamster
User=ubuntu
Group=ubuntu
#EnvironmentFile=/etc/sysconfig/master.env
#Environment="PYTHONPATH=/home/ubuntu/venv"
ExecStart=/home/ubuntu/venv /venv/bin/rqworker master
StandardOutput=/home/ubuntu/logs/icengine/std_out.log
StandardError=/home/ubuntu/logs/icengine/std_err/log
#SyslogIdentifier=icengin
KillMode=process
Restart=always
TimeoutSec=infinity
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=master.service


Initially this service is Actiating(Start) but was not Active



But after i made some changes and now it showing error:



After running sudo systemctl start rq



(venv) ubuntu@ubuntucalc:~$ sudo systemctl status rq
● rq.service - rqworker daemon
Loaded: loaded (/etc/systemd/system/rq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-15 06:53:20 UTC; 4s ago
Process: 18537 ExecStart=/home/ubuntu/venv /venv/bin/rqworker master (code=exited, status=200/CHDIR)
Main PID: 18537 (code=exited, status=200/CHDIR)

Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Main process exited, code=exited, status=200/CHDIR
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Service hold-off time over, scheduling restart.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Scheduled restart job, restart counter is at 5.
Jan 15 06:53:20 ubuntucalc systemd[1]: Stopped rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Start request repeated too quickly.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.


This is the output i have got.
Thanks










share|improve this question
















Systemd service, I want to create but it fails.
This is my service i have created.



[Unit]
Description=rqworker daemon
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/mamster
User=ubuntu
Group=ubuntu
#EnvironmentFile=/etc/sysconfig/master.env
#Environment="PYTHONPATH=/home/ubuntu/venv"
ExecStart=/home/ubuntu/venv /venv/bin/rqworker master
StandardOutput=/home/ubuntu/logs/icengine/std_out.log
StandardError=/home/ubuntu/logs/icengine/std_err/log
#SyslogIdentifier=icengin
KillMode=process
Restart=always
TimeoutSec=infinity
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=master.service


Initially this service is Actiating(Start) but was not Active



But after i made some changes and now it showing error:



After running sudo systemctl start rq



(venv) ubuntu@ubuntucalc:~$ sudo systemctl status rq
● rq.service - rqworker daemon
Loaded: loaded (/etc/systemd/system/rq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-01-15 06:53:20 UTC; 4s ago
Process: 18537 ExecStart=/home/ubuntu/venv /venv/bin/rqworker master (code=exited, status=200/CHDIR)
Main PID: 18537 (code=exited, status=200/CHDIR)

Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Main process exited, code=exited, status=200/CHDIR
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Service hold-off time over, scheduling restart.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Scheduled restart job, restart counter is at 5.
Jan 15 06:53:20 ubuntucalc systemd[1]: Stopped rqworker daemon.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Start request repeated too quickly.
Jan 15 06:53:20 ubuntucalc systemd[1]: rq.service: Failed with result 'exit-code'.
Jan 15 06:53:20 ubuntucalc systemd[1]: Failed to start rqworker daemon.


This is the output i have got.
Thanks







server systemd services redis supervisor






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 15 at 7:23







Rajat jain

















asked Jan 15 at 7:04









Rajat jainRajat jain

103




103













  • What does the std_out / std_err logs say ?

    – Soren A
    Jan 15 at 7:32











  • @SorenA well this makes it more complicate. Even logs are also not recording.

    – Rajat jain
    Jan 15 at 8:19











  • You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

    – PerlDuck
    Jan 15 at 8:55








  • 1





    wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

    – Rajat jain
    Jan 15 at 9:11











  • But still my Logs not generate!!!

    – Rajat jain
    Jan 15 at 9:13



















  • What does the std_out / std_err logs say ?

    – Soren A
    Jan 15 at 7:32











  • @SorenA well this makes it more complicate. Even logs are also not recording.

    – Rajat jain
    Jan 15 at 8:19











  • You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

    – PerlDuck
    Jan 15 at 8:55








  • 1





    wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

    – Rajat jain
    Jan 15 at 9:11











  • But still my Logs not generate!!!

    – Rajat jain
    Jan 15 at 9:13

















What does the std_out / std_err logs say ?

– Soren A
Jan 15 at 7:32





What does the std_out / std_err logs say ?

– Soren A
Jan 15 at 7:32













@SorenA well this makes it more complicate. Even logs are also not recording.

– Rajat jain
Jan 15 at 8:19





@SorenA well this makes it more complicate. Even logs are also not recording.

– Rajat jain
Jan 15 at 8:19













You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

– PerlDuck
Jan 15 at 8:55







You have two lines Type=. The given type must match the type of the program. For daemons, often forking is right but it depends on how /home/ubuntu/venv works.

– PerlDuck
Jan 15 at 8:55






1




1





wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

– Rajat jain
Jan 15 at 9:11





wow! @PerlDuck Thanks for letting my attention to the Type= , I didn't noticed that i have two Type and finally i removed both beacuse i need Type=simple. Which is default. So again THANKS! Type same in Answer and i'll approve :)

– Rajat jain
Jan 15 at 9:11













But still my Logs not generate!!!

– Rajat jain
Jan 15 at 9:13





But still my Logs not generate!!!

– Rajat jain
Jan 15 at 9:13










1 Answer
1






active

oldest

votes


















1














There are some issues in that unit file:




  • The file contains two instances of Type=, one
    with simple and one with notify. It must contain
    only one such line and that must be of the proper
    type which in turn depends on how the executable
    /home/ubuntu/venv behaves. For daemons, often forking
    is used.

  • The filename given for StandardError should presumably be
    /home/ubuntu/logs/icengine/std_err.log and not
    /home/ubuntu/logs/icengine/std_err/log. Make sure the user
    ubuntu is able to write to that location and the directories
    exist. I reckon systemd won't create the path if it doesn't
    exist (although it'll create the file).

  • The syntax of StandardOutput= and StandardError= is wrong.
    According to the docs the sysntax is
    StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log.
    Same for StandardError.






share|improve this answer


























  • Great!! Thanks. IT WORKED

    – Rajat jain
    Jan 15 at 12:46











  • I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

    – Rajat jain
    Feb 7 at 14:11













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109834%2fsystemd-rqworker-service%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














There are some issues in that unit file:




  • The file contains two instances of Type=, one
    with simple and one with notify. It must contain
    only one such line and that must be of the proper
    type which in turn depends on how the executable
    /home/ubuntu/venv behaves. For daemons, often forking
    is used.

  • The filename given for StandardError should presumably be
    /home/ubuntu/logs/icengine/std_err.log and not
    /home/ubuntu/logs/icengine/std_err/log. Make sure the user
    ubuntu is able to write to that location and the directories
    exist. I reckon systemd won't create the path if it doesn't
    exist (although it'll create the file).

  • The syntax of StandardOutput= and StandardError= is wrong.
    According to the docs the sysntax is
    StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log.
    Same for StandardError.






share|improve this answer


























  • Great!! Thanks. IT WORKED

    – Rajat jain
    Jan 15 at 12:46











  • I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

    – Rajat jain
    Feb 7 at 14:11


















1














There are some issues in that unit file:




  • The file contains two instances of Type=, one
    with simple and one with notify. It must contain
    only one such line and that must be of the proper
    type which in turn depends on how the executable
    /home/ubuntu/venv behaves. For daemons, often forking
    is used.

  • The filename given for StandardError should presumably be
    /home/ubuntu/logs/icengine/std_err.log and not
    /home/ubuntu/logs/icengine/std_err/log. Make sure the user
    ubuntu is able to write to that location and the directories
    exist. I reckon systemd won't create the path if it doesn't
    exist (although it'll create the file).

  • The syntax of StandardOutput= and StandardError= is wrong.
    According to the docs the sysntax is
    StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log.
    Same for StandardError.






share|improve this answer


























  • Great!! Thanks. IT WORKED

    – Rajat jain
    Jan 15 at 12:46











  • I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

    – Rajat jain
    Feb 7 at 14:11
















1












1








1







There are some issues in that unit file:




  • The file contains two instances of Type=, one
    with simple and one with notify. It must contain
    only one such line and that must be of the proper
    type which in turn depends on how the executable
    /home/ubuntu/venv behaves. For daemons, often forking
    is used.

  • The filename given for StandardError should presumably be
    /home/ubuntu/logs/icengine/std_err.log and not
    /home/ubuntu/logs/icengine/std_err/log. Make sure the user
    ubuntu is able to write to that location and the directories
    exist. I reckon systemd won't create the path if it doesn't
    exist (although it'll create the file).

  • The syntax of StandardOutput= and StandardError= is wrong.
    According to the docs the sysntax is
    StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log.
    Same for StandardError.






share|improve this answer















There are some issues in that unit file:




  • The file contains two instances of Type=, one
    with simple and one with notify. It must contain
    only one such line and that must be of the proper
    type which in turn depends on how the executable
    /home/ubuntu/venv behaves. For daemons, often forking
    is used.

  • The filename given for StandardError should presumably be
    /home/ubuntu/logs/icengine/std_err.log and not
    /home/ubuntu/logs/icengine/std_err/log. Make sure the user
    ubuntu is able to write to that location and the directories
    exist. I reckon systemd won't create the path if it doesn't
    exist (although it'll create the file).

  • The syntax of StandardOutput= and StandardError= is wrong.
    According to the docs the sysntax is
    StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log.
    Same for StandardError.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 15 at 13:15

























answered Jan 15 at 11:54









PerlDuckPerlDuck

6,74711535




6,74711535













  • Great!! Thanks. IT WORKED

    – Rajat jain
    Jan 15 at 12:46











  • I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

    – Rajat jain
    Feb 7 at 14:11





















  • Great!! Thanks. IT WORKED

    – Rajat jain
    Jan 15 at 12:46











  • I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

    – Rajat jain
    Feb 7 at 14:11



















Great!! Thanks. IT WORKED

– Rajat jain
Jan 15 at 12:46





Great!! Thanks. IT WORKED

– Rajat jain
Jan 15 at 12:46













I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

– Rajat jain
Feb 7 at 14:11







I was looking at it and just now i realised that for StandardError=file:/path/ it won't work there are some additional need to specify some inherit thing, I didn't know how it works??? StandardOutput=file:/home/ubuntu/logs/master_std_out.log StandardError=file:/home/ubuntu/logs/master_std_err.log

– Rajat jain
Feb 7 at 14:11




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109834%2fsystemd-rqworker-service%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents