Cloud 9 Autorun Directory

I am having some problems understanding exactly what happens when I place a program in the autorun directory under Cloud9. I have put several simple programs in there and they all run fine on startup. However . . .

I have a JavaScript web server and an HTML file in a directory under Cloud9. Everything works perfectly with them when I run the JavaScript file from Cloud9. But I want it to autorun on startup. When I place a copy of the JavaScript file in the autorun directory, it does start on startup. However, I get an error saying it can’t open the HTML file.

I thought, OK, it needs the path to the HTML file from its new location in the autorun directory, but that didn’t. I thought maybe the system treats programs in the autorun directory as though they are in the cloud9 root directory. That path doesn’t work either. I even tried putting a copy of the HTML file in the startup directory with the JavaScript file. It still says it can’t open the HTML file. I have tried leaving the JavaScipt file in its original location, and putting a link file in the autorun directory. I still get the same can’t open the HTML file.

I have tried every path I could think of, and I still can’t get it to open up the HTML file when trying run it from the autorun directory. There is obviously something going on here that I don’t understand!

Well, I have resolved this in part by using the absolute or full path to the HTML file. It now works. But it still begs the question: from what directory does the JavaScript file think its actually running from, if its not cloud9/autorun?

I had the same problem, but i took a look at the service file in system for the startup Bone script Cloud9, it’s like this:

[Unit] Description=Bonescript autorun ConditionPathExists=|/var/lib/cloud9

[Service] WorkingDirectory=/usr/local/lib/node_modules/bonescript EnvironmentFile=/etc/default/node ExecStart=/usr/bin/node autorun.js SyslogIdentifier=bonescript-autorun

[Install] WantedBy=multi-user.target I tried to place the HTML file under WorkingDirectory (/usr/local/lib/node_modules/bonescript) and the JavaScript file kept it under the autorun directory of Cloud9 and waw everything works perfectly :wink: