17

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
2
  • 4
    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, 2018 at 18:31
  • @Ubunfu - Got a similar error from unbound after initial installation, since it didn't like port 53 being in use. But systemctl wasn't able/willing to share that info, so your advice proved invaluable. Thanks! +1
    – Kenny83
    Nov 11, 2021 at 7:27

3 Answers 3

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
0

When using the User= setting, there is no need to set the group (since it will be set to the users default group).

DynamicUser=yes may be a suggestion instead of nobody user (systemd.exec(8)), which runs the service under a non-existent user which only exists within the service environment instead of using a real account (rather create a system user for the purpose).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .