systemd rqworker service
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
|
show 2 more comments
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
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 linesType=
. The given type must match the type of the program. For daemons, oftenforking
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 theType=
, I didn't noticed that i have twoType
and finally i removed both beacuse i needType=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
|
show 2 more comments
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
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
server systemd services redis supervisor
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 linesType=
. The given type must match the type of the program. For daemons, oftenforking
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 theType=
, I didn't noticed that i have twoType
and finally i removed both beacuse i needType=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
|
show 2 more comments
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 linesType=
. The given type must match the type of the program. For daemons, oftenforking
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 theType=
, I didn't noticed that i have twoType
and finally i removed both beacuse i needType=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
|
show 2 more comments
1 Answer
1
active
oldest
votes
There are some issues in that unit file:
- The file contains two instances of
Type=
, one
withsimple
and one withnotify
. 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, oftenforking
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 reckonsystemd
won't create the path if it doesn't
exist (although it'll create the file). - The syntax of
StandardOutput=
andStandardError=
is wrong.
According to the docs the sysntax is
StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log
.
Same forStandardError
.
Great!! Thanks. IT WORKED
– Rajat jain
Jan 15 at 12:46
I was looking at it and just now i realised that forStandardError=file:/path/
it won't work there are some additional need to specify someinherit
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
There are some issues in that unit file:
- The file contains two instances of
Type=
, one
withsimple
and one withnotify
. 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, oftenforking
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 reckonsystemd
won't create the path if it doesn't
exist (although it'll create the file). - The syntax of
StandardOutput=
andStandardError=
is wrong.
According to the docs the sysntax is
StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log
.
Same forStandardError
.
Great!! Thanks. IT WORKED
– Rajat jain
Jan 15 at 12:46
I was looking at it and just now i realised that forStandardError=file:/path/
it won't work there are some additional need to specify someinherit
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
add a comment |
There are some issues in that unit file:
- The file contains two instances of
Type=
, one
withsimple
and one withnotify
. 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, oftenforking
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 reckonsystemd
won't create the path if it doesn't
exist (although it'll create the file). - The syntax of
StandardOutput=
andStandardError=
is wrong.
According to the docs the sysntax is
StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log
.
Same forStandardError
.
Great!! Thanks. IT WORKED
– Rajat jain
Jan 15 at 12:46
I was looking at it and just now i realised that forStandardError=file:/path/
it won't work there are some additional need to specify someinherit
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
add a comment |
There are some issues in that unit file:
- The file contains two instances of
Type=
, one
withsimple
and one withnotify
. 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, oftenforking
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 reckonsystemd
won't create the path if it doesn't
exist (although it'll create the file). - The syntax of
StandardOutput=
andStandardError=
is wrong.
According to the docs the sysntax is
StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log
.
Same forStandardError
.
There are some issues in that unit file:
- The file contains two instances of
Type=
, one
withsimple
and one withnotify
. 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, oftenforking
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 reckonsystemd
won't create the path if it doesn't
exist (although it'll create the file). - The syntax of
StandardOutput=
andStandardError=
is wrong.
According to the docs the sysntax is
StandardOutput=file:/home/ubuntu/logs/icengine/std_out.log
.
Same forStandardError
.
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 forStandardError=file:/path/
it won't work there are some additional need to specify someinherit
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
add a comment |
Great!! Thanks. IT WORKED
– Rajat jain
Jan 15 at 12:46
I was looking at it and just now i realised that forStandardError=file:/path/
it won't work there are some additional need to specify someinherit
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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, oftenforking
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 twoType
and finally i removed both beacuse i needType=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