14

I have created a service on Debian 8.6 and as I'm trying to start it using the service command, I receive an error.

I have tried systemctl daemon-reload, but still getting the same result.

$ sudo service cloud9 start
$ sudo service cloud9 status
● cloud9.service - cloud9
   Loaded: loaded (/etc/systemd/system/cloud9.service; enabled)
   Active: failed (Result: start-limit) since Thu 2016-10-13 07:21:02 UTC; 2s ago
  Process: 2610 ExecStart=/opt/bitnami/nodejs/bin/node /home/user/c9sdk/server.js -w /home/user -l 0.0.0.0 -a admin:admin (code=exited, status=216/GROUP)
 Main PID: 2610 (code=exited, status=216/GROUP)

Oct 13 07:21:02 test-vm systemd[1]: cloud9.service: main process exited, code=exited, status=216/GROUP
Oct 13 07:21:02 test-vm systemd[1]: Unit cloud9.service entered failed state.
Oct 13 07:21:02 test-vm systemd[1]: cloud9.service holdoff time over, scheduling restart.
Oct 13 07:21:02 test-vm systemd[1]: Stopping cloud9...
Oct 13 07:21:02 test-vm systemd[1]: Starting cloud9...
Oct 13 07:21:02 test-vm systemd[1]: cloud9.service start request repeated too quickly, refusing to start.
Oct 13 07:21:02 test-vm systemd[1]: Failed to start cloud9.
Oct 13 07:21:02 test-vm systemd[1]: Unit cloud9.service entered failed state.

The config is in /etc/systemd/system/cloud9.service:

[Unit]
Description=cloud9

[Service]
ExecStart=/opt/bitnami/nodejs/bin/node /home/user/c9sdk/server.js -w /home/user -l 0.0.0.0 -a admin:admin
Restart=always
User=nobody
Group=nobody
Environment=PATH=/bin:/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/user/c9sdk

[Install]
WantedBy=multi-user.target
  • 1
    If the error printed by systemctl is not very clear, it may be because the root cause is being swallowed and masked as a generic failure to start. A possibly helpful way to figure out why it's failing could be to just manually run the command specified in the ExecStart directive. In my case the root cause popped right out at me. – Ubunfu Jun 6 '18 at 18:31
6
2610 ExecStart=/opt/bitnami/nodejs/bin/node /home/user/c9sdk/server.js -w /home/user -l 0.0.0.0 -a admin:admin (code=exited, status=216/GROUP)
…
Oct 13 07:21:02 test-vm systemd[1]: cloud9.service: main process exited, code=exited, status=216/GROUP

… which describes the problem. Your group nobody is not a valid group on your system. Specify a valid group.

Environment=PATH=/bin:/usr/bin:/usr/local/bin

This is probably unnecessary.

-w /home/user -l 0.0.0.0

In a better world, the cloud9 service program here would receive its listening socket as an open file descriptor, and inherit its working directory (which, ironically, you have explicitly set elsewhere in the unit).

Further reading

2

Removing the Restart parameter and adding a valid user/group helped me to solve the problem.

[Unit]
Description=cloud9

[Service]
ExecStart=/opt/bitnami/nodejs/bin/node /home/user/c9sdk/server.js -w /home/user -l 0.0.0.0 -a admin:admin
User=user
Group=group
Environment=PATH=/bin:/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/user/c9sdk

[Install]
WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.