Problem creating a service on Debian
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a Sinatra application at /my/app/folder/app.rb which I normally execute on my local machine with the command rackup -p 9210
. I would like to create a service that starts the app at every boot and restart. I have tried the following but it did not work:
$ vim /lib/systemd/system/mydaemon.service
[Unit]
Description=Simple supervisor
[Service]
User=username
Group=username
WorkingDirectory=/my/app/folder/
Restart=always
ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210
Then I reload the deamons:systemctl- deamon-reload
, start the service: systemctl start mydaemon
and check status and I get this error:
â mydeamon.service - Simple deamon
Loaded: loaded (/lib/systemd/system/mydeamon.service; static)
Active: failed (Result: start-limit) since Wed 2017-12-06 17:07:39 GMT; 5s ago
Process: 355 ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210 (code=exited, status=127)
Main PID: 355 (code=exited, status=127)
mydeamon.service: main process exited, code=exited, status=127/n/a
Unit mydeamon.service entered failed state.
mydeamon.service holdoff time over, scheduling restart.
Stopping Simple deamon...
Starting Simple deamon...
mydeamon.service start request repeated too quickly, refusing to start.
Failed to start Simple deamon.
Unit mydeamon.service entered failed state.
What am I missing here?
I use RVM so I have also tried:
ExecStart=/usr/local/rvm/wrappers/ruby-2.3.0/rackup -p 9210
but it didn't work either.
I would appreciate any suggestions.
debian systemd services
add a comment |Â
up vote
0
down vote
favorite
I have a Sinatra application at /my/app/folder/app.rb which I normally execute on my local machine with the command rackup -p 9210
. I would like to create a service that starts the app at every boot and restart. I have tried the following but it did not work:
$ vim /lib/systemd/system/mydaemon.service
[Unit]
Description=Simple supervisor
[Service]
User=username
Group=username
WorkingDirectory=/my/app/folder/
Restart=always
ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210
Then I reload the deamons:systemctl- deamon-reload
, start the service: systemctl start mydaemon
and check status and I get this error:
â mydeamon.service - Simple deamon
Loaded: loaded (/lib/systemd/system/mydeamon.service; static)
Active: failed (Result: start-limit) since Wed 2017-12-06 17:07:39 GMT; 5s ago
Process: 355 ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210 (code=exited, status=127)
Main PID: 355 (code=exited, status=127)
mydeamon.service: main process exited, code=exited, status=127/n/a
Unit mydeamon.service entered failed state.
mydeamon.service holdoff time over, scheduling restart.
Stopping Simple deamon...
Starting Simple deamon...
mydeamon.service start request repeated too quickly, refusing to start.
Failed to start Simple deamon.
Unit mydeamon.service entered failed state.
What am I missing here?
I use RVM so I have also tried:
ExecStart=/usr/local/rvm/wrappers/ruby-2.3.0/rackup -p 9210
but it didn't work either.
I would appreciate any suggestions.
debian systemd services
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Sinatra application at /my/app/folder/app.rb which I normally execute on my local machine with the command rackup -p 9210
. I would like to create a service that starts the app at every boot and restart. I have tried the following but it did not work:
$ vim /lib/systemd/system/mydaemon.service
[Unit]
Description=Simple supervisor
[Service]
User=username
Group=username
WorkingDirectory=/my/app/folder/
Restart=always
ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210
Then I reload the deamons:systemctl- deamon-reload
, start the service: systemctl start mydaemon
and check status and I get this error:
â mydeamon.service - Simple deamon
Loaded: loaded (/lib/systemd/system/mydeamon.service; static)
Active: failed (Result: start-limit) since Wed 2017-12-06 17:07:39 GMT; 5s ago
Process: 355 ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210 (code=exited, status=127)
Main PID: 355 (code=exited, status=127)
mydeamon.service: main process exited, code=exited, status=127/n/a
Unit mydeamon.service entered failed state.
mydeamon.service holdoff time over, scheduling restart.
Stopping Simple deamon...
Starting Simple deamon...
mydeamon.service start request repeated too quickly, refusing to start.
Failed to start Simple deamon.
Unit mydeamon.service entered failed state.
What am I missing here?
I use RVM so I have also tried:
ExecStart=/usr/local/rvm/wrappers/ruby-2.3.0/rackup -p 9210
but it didn't work either.
I would appreciate any suggestions.
debian systemd services
I have a Sinatra application at /my/app/folder/app.rb which I normally execute on my local machine with the command rackup -p 9210
. I would like to create a service that starts the app at every boot and restart. I have tried the following but it did not work:
$ vim /lib/systemd/system/mydaemon.service
[Unit]
Description=Simple supervisor
[Service]
User=username
Group=username
WorkingDirectory=/my/app/folder/
Restart=always
ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210
Then I reload the deamons:systemctl- deamon-reload
, start the service: systemctl start mydaemon
and check status and I get this error:
â mydeamon.service - Simple deamon
Loaded: loaded (/lib/systemd/system/mydeamon.service; static)
Active: failed (Result: start-limit) since Wed 2017-12-06 17:07:39 GMT; 5s ago
Process: 355 ExecStart=/usr/local/rvm/gems/ruby-2.3.0/bin/rackup -p 9210 (code=exited, status=127)
Main PID: 355 (code=exited, status=127)
mydeamon.service: main process exited, code=exited, status=127/n/a
Unit mydeamon.service entered failed state.
mydeamon.service holdoff time over, scheduling restart.
Stopping Simple deamon...
Starting Simple deamon...
mydeamon.service start request repeated too quickly, refusing to start.
Failed to start Simple deamon.
Unit mydeamon.service entered failed state.
What am I missing here?
I use RVM so I have also tried:
ExecStart=/usr/local/rvm/wrappers/ruby-2.3.0/rackup -p 9210
but it didn't work either.
I would appreciate any suggestions.
debian systemd services
edited Dec 6 '17 at 17:50
Jeff Schaller
32k848109
32k848109
asked Dec 6 '17 at 17:46
jedi
1186
1186
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19
add a comment |Â
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409266%2fproblem-creating-a-service-on-debian%23new-answer', 'question_page');
);
Post as a guest
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
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
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
I think status 127 is "not executable", due to can't find the path or not allowed to execute it. Did you try running the command specified in ExecStart manually?
â mjb2kmn
Dec 8 '17 at 23:09
Also a side note: you should add services to /etc/systemd/system/, not /lib/systemd/system/.
â mjb2kmn
Dec 8 '17 at 23:11
And you're missing a "WantedBy", although to be honest I'm not 100% certain it's required. Docs here: freedesktop.org/software/systemd/man/systemd.service.html
â mjb2kmn
Dec 8 '17 at 23:19