3

I am trying to automate running Cloud9, by setting it as a service on Debian. This error stops me:

$ sudo service cloud9 start
Failed to start cloud9.service: Unit cloud9.service failed to load: Invalid argument. See system logs and 'systemctl status cloud9.service' for details.

systemctl status cloud9.service output:

$ systemctl status cloud9.service
● cloud9.service - cloud9
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Probably it is due to misconfiguration in /etc/systemd/system/cloud9.service, which I just created:

[Unit]
Description=cloud9

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

[Install]
WantedBy=multi-user.target

How to create a simple startup script for the service?

Peter Gerhat
  • 1,202
  • 5
  • 17
  • 30

2 Answers2

6

Your first clue is that the diagnostic said to check the output of systemctl status cloud9.service, but you didn't mention doing that or sharing that output.

Perhaps it will tell you that the path the binary you pass to ExecStart= must be absolute.

Mark Stosberg
  • 7,420
  • 1
  • 32
  • 42
1

Generally, the "Invalid argument" here is the unit definition file itself. To debug it you can use:

sudo systemd-analyze verify cloud9.service

or in case of user's local service:

sudo systemd-analyze --user verify cloud9.service

teejay
  • 111
  • 2