Invalid argument while starting Cloud9 service on startup

11,215

Solution 1

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.

Solution 2

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

Share:
11,215

Related videos on Youtube

Peter Gerhat
Author by

Peter Gerhat

My profile is that of a software product owner with a strong engineering background. I like building end-to-end solutions that typically require a mix of technical skills, business skills, and mathematical knowledge. I understand how to optimize data algorithms, and how to explain my findings. My technical background allows me to deal with data at scale. I'm an active learner with a strong aptitude towards technology and discovering the new. My areas of expertise are Mobile and Data Analytics. I have a niche for data-driven apps. That area poses a set of new challenges and opportunities and also it is one of the most rapidly growing fields.

Updated on September 18, 2022

Comments

  • Peter Gerhat
    Peter Gerhat almost 2 years

    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
    Peter Gerhat over 7 years
    The details from systemctl are already appended to the question.
  • Peter Gerhat
    Peter Gerhat over 7 years
    This solved the problem, I used both absolute paths to node.js and the server.js
  • Salim
    Salim about 6 years
    I was using ExecStart=~/script.sh, it wont work, and now I used an absolute path and it works.