Cloud9 IDE Update (c9-core-installer_3.1.3543)

Hey Everyone,

I just pushed out a new Cloud9 IDE update. This fixes one of the
long-standing problems between github.com/c9/core and our version..

"hints" & "autocomplete" things now show up as you start typing stuff..

do i know why it now works, not really... i had tweaked the build
setup, and while testing I just noticed hints are working..

Regards,

Robert:
Presently Cloud 9 runs as root. Would it be possible for it to run as debian instead? That would mean the examples would have to run with sudo.

Seems like this would be much more secure.

–Mark

With yesterday's build It's actually really really easy:

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#

User=debian

cat /lib/systemd/system/cloud9.service
[Unit]
Description=Cloud9 IDE
ConditionPathExists=|/var/lib/cloud9

[Service]
WorkingDirectory=/opt/cloud9/build/standalonebuild
EnvironmentFile=/etc/default/cloud9
ExecStart=/usr/bin/nodejs server.js --packed -w /var/lib/cloud9
SyslogIdentifier=cloud9ide
User=debian

Still a few issues:

https://i.imgur.com/amVHbaE.png

Apr 13 14:34:29 beaglebone cloud9ide[528]: LISTEN_FDS = 1
Apr 13 14:34:29 beaglebone cloud9ide[528]: Connect server listening at
http://127.0.0.1:3000
Apr 13 14:34:30 beaglebone cloud9ide[528]: CDN: version standalone
initialized /opt/cloud9/build/standalonebuild/build
Apr 13 14:34:30 beaglebone systemd-timesyncd[273]: Synchronized to
time server 154.16.245.246:123 (2.debian.pool.ntp.org).
Apr 13 14:34:32 beaglebone cloud9ide[528]: Started
'/opt/cloud9/build/standalonebuild/configs/standalone' with config
'standalone'!
Apr 13 14:34:32 beaglebone cloud9ide[528]: Cloud9 is up and running
Apr 13 14:34:35 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/config/default.js
Apr 13 14:34:35 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/config/default.js
Apr 13 14:34:36 beaglebone bonescript-autorun[348]: 4:4:60-ti-r97
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/skin/default/dark.css
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/skin/default/dark.css
Apr 13 14:34:36 beaglebone bonescript-autorun[348]: info: Starting
bonescript autorun service
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/cloud9_night_low_color.js
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/cloud9_night_low_color.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/worker/plugins/c9.ide.language.core/worker.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/idle_fingers.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/worker/plugins/c9.ide.language.core/worker.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/idle_fingers.js
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/opt/cloud9/.c9/user.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/project.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: ENOENT: no such
file or directory, open '/var/lib/cloud9/.c9/metadata/tab2'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:47 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:47 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:47 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:47 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:59 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:59 beaglebone cloud9ide[528]: at Error (native)

(i'm going to create "cloud9" group and tie /var/lib/cloud9/ and
debian to that group..

and all the examples are broken: (aka |> Run button)

https://i.imgur.com/rNt0TPR.png

So other then all bonescript examples broken, it works. :wink:

@Drew, in the python adafruit library you have a gpio/etc debian
permission script, wonder if we should enable that by default, then
the bonescript examples would work as debian user.

Regards,

Still a few issues:

https://i.imgur.com/amVHbaE.png

Apr 13 14:34:29 beaglebone cloud9ide[528]: LISTEN_FDS = 1
Apr 13 14:34:29 beaglebone cloud9ide[528]: Connect server listening at
http://127.0.0.1:3000
Apr 13 14:34:30 beaglebone cloud9ide[528]: CDN: version standalone
initialized /opt/cloud9/build/standalonebuild/build
Apr 13 14:34:30 beaglebone systemd-timesyncd[273]: Synchronized to
time server 154.16.245.246:123 (2.debian.pool.ntp.org).
Apr 13 14:34:32 beaglebone cloud9ide[528]: Started
'/opt/cloud9/build/standalonebuild/configs/standalone' with config
'standalone'!
Apr 13 14:34:32 beaglebone cloud9ide[528]: Cloud9 is up and running
Apr 13 14:34:35 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/config/default.js
Apr 13 14:34:35 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/config/default.js
Apr 13 14:34:36 beaglebone bonescript-autorun[348]: 4:4:60-ti-r97
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/skin/default/dark.css
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/skin/default/dark.css
Apr 13 14:34:36 beaglebone bonescript-autorun[348]: info: Starting
bonescript autorun service
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/cloud9_night_low_color.js
Apr 13 14:34:36 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/cloud9_night_low_color.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/worker/plugins/c9.ide.language.core/worker.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/idle_fingers.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/worker/plugins/c9.ide.language.core/worker.js
Apr 13 14:34:37 beaglebone cloud9ide[528]: cache hit
/opt/cloud9/build/standalonebuild/build/standalone/modules/ace/theme/idle_fingers.js
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/opt/cloud9/.c9/user.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/project.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:42 beaglebone cloud9ide[528]: 768: Error: ENOENT: no such
file or directory, open '/var/lib/cloud9/.c9/metadata/tab2'
Apr 13 14:34:42 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:47 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:47 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:47 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:47 beaglebone cloud9ide[528]: at Error (native)
Apr 13 14:34:59 beaglebone cloud9ide[528]: 768: Error: EACCES:
permission denied, open '/var/lib/cloud9/.c9/state.settings'
Apr 13 14:34:59 beaglebone cloud9ide[528]: at Error (native)

(i'm going to create "cloud9" group and tie /var/lib/cloud9/ and
debian to that group..

Okay, the permissions are now taken care of:

https://github.com/RobertCNelson/omap-image-builder/commit/7f47e1f6fbbd23835ae14dce0face69c44171378

https://github.com/rcn-ee/repos/commit/be34382757f990d6d6b21de745cd338dbafec0b7

and all the examples are broken: (aka |> Run button)

https://i.imgur.com/rNt0TPR.png

So other then all bonescript examples broken, it works. :wink:

@Drew, in the python adafruit library you have a gpio/etc debian
permission script, wonder if we should enable that by default, then
the bonescript examples would work as debian user.

Here's the udev rules:

https://github.com/adafruit/adafruit-beaglebone-io-python/tree/master/udev

Regards,

Robert:
Wow, that was quick. So then Cloud 9 runs a debian now and the udev script sets all the gpio /sys/ files to be owned by debian.

So do I need to grab next week’s build to test it?

–Mark

Robert:
  Wow, that was quick. So then Cloud 9 runs a debian now and the udev
script sets all the gpio /sys/ files to be owned by debian.

No, it's still root by default.. It's a one line change to get Cloud9
running as debian user via the service file (with a reboot). and i
think that udev rule should make it work without being root. We just
need someone to test it. :wink:

So do I need to grab next week's build to test it?

I just fired up a build, while you could tweak last Sunday's image,
you'd have to manually add the new cloud9ide group and run apt
update/apt upgrade.. or just wait for a test build in about an hour.
:wink:

Regards,

I’ll wait for the new image. It hasn’t popped up yet.

–Mark

yeah, ran into a small problem of install order:

https://github.com/rcn-ee/repos/commit/2b52ed42fa6a33c2e25e42fe68dce582113ced4b

It's almost done. :wink:

Regards,

Hey Everyone,

I just pushed out a new Cloud9 IDE update. This fixes one of the
long-standing problems between github.com/c9/core and our version..

"hints" & "autocomplete" things now show up as you start typing stuff..

do i know why it now works, not really... i had tweaked the build
setup, and while testing I just noticed hints are working..

Can a student run all the demos in the Cookbook? How do we make that an every 6 weeks task for students? :wink:

Okay give this a shot:

https://rcn-ee.net/rootfs/bb.org/testing/2017-04-13/stretch-iot/

add 'User=debian' to the end of /lib/systemd/system/cloud9.service

and also run:

sudo chown -R :cloud9ide /var/lib/cloud9/ || true
sudo chmod -R g+w /var/lib/cloud9/ || true
sudo chown -R :cloud9ide /opt/cloud9/.c9/ || true
sudo chmod -R g+w /opt/cloud9/.c9/ || true

as for some reason the package still didn't fix those...

Regards,

I’m flashing it now. Wow, things really download fast when you aren’t competing with 2000 students.

–Mark

Well, it’s running. Here’s a couple of things I notice:

  1. The message “Failed to write to ‘state.settings’. Access denied acccessing this file or folder.” Keeps flashing in red above the edit window.

  2. The terminal window starts in /var/lib/cloud9. (A good place to start.) Typing cd changes you to /opt/cloud9 which is owned by root. I think it should be /home/debian.

I’ll keep playing around with it.

–Mark

Well, it's running. Here's a couple of things I notice:

1. The message "Failed to write to 'state.settings'. Access denied
acccessing this file or folder." Keeps flashing in red above the edit
window.

That's what this would fix..

sudo chown -R :cloud9ide /var/lib/cloud9/ || true
sudo chmod -R g+w /var/lib/cloud9/ || true
sudo chown -R :cloud9ide /opt/cloud9/.c9/ || true
sudo chmod -R g+w /opt/cloud9/.c9/ || true

but you can try:

sudo apt update ; sudo apt upgrade

as i pushed another new bone101/c9-core-installer update which should do above ^

2. The terminal window starts in /var/lib/cloud9. (A good place to start.)
Typing cd changes you to /opt/cloud9 which is owned by root. I think it
should be /home/debian.

/opt/cloud9/ is the home directory for cloud9 application. :wink:

otherwise i haven't found where that is spawn'ed yet..

Regards,

finally, those directories have the correct permissions on a clean build. :wink:

Have you had any luck with Drew's udev rule?

Regards,

Yup, the chown/chmod fixed it, and the apt upgrade appears to have worked too.

As for the udev rules, no. I still need to sudo to access the gpio pins. Looks like everything is still root:root.

dmesg[1] doesn’t seem to show anything.

–Mark

[1] http://paste.debian.net/927517/

Did you add the udev rule? It's not packaged.. and i just tried it,
maybe Drew knows what's going on:

installed via:

wget https://github.com/adafruit/adafruit-beaglebone-io-python/raw/master/udev/80-non-root-gpio-permissions.rules
wget https://github.com/adafruit/adafruit-beaglebone-io-python/raw/master/udev/udev-non-root-gpio-permissions.sh
sudo mv udev-non-root-gpio-permissions.sh /usr/local/bin/
sudo chmod +x /usr/local/bin/udev-non-root-gpio-permissions.sh
sudo mv 80-non-root-gpio-permissions.rules /etc/udev/rules.d/
sudo reboot

BUT serial login is toast:

[ OK ] Reached target Host and Network Name Lookups.
[ TIME ] Timed out waiting for device dev-ttyS0.device.
[DEPEND] Dependency failed for Serial Getty on ttyS0.
[ TIME ] Timed out waiting for device dev-ttyGS0.device.
[DEPEND] Dependency failed for Serial Getty on ttyGS0.
[ OK ] Reached target Login Prompts.
[ OK ] Started Generic Board Startup.
         Starting BB WL18xx Bluetooth Service...
[ OK ] Started BB WL18xx Bluetooth Service.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.

<aka no login prompt>

ssh over eth0 works..

debian@beaglebone:~$ ls -lh /sys/class/gpio/
total 0
--w--w---- 1 debian debian 4.0K Apr 13 19:57 export
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio112 ->
../../devices/platform/ocp/481ae000.gpio/gpio/gpio112
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio114 ->
../../devices/platform/ocp/481ae000.gpio/gpio/gpio114
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio115 ->
../../devices/platform/ocp/481ae000.gpio/gpio/gpio115
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio116 ->
../../devices/platform/ocp/481ae000.gpio/gpio/gpio116
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio14 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio14
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio15 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio15
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio2 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio2
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio20 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio20
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio22 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio22
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio23 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio23
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio26 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio26
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio27 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio27
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio3 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio3
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio30 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio30
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio31 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio31
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio4 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio4
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio44 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio44
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio45 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio45
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio46 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio46
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio47 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio47
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio48 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio48
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio49 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio49
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio5 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio5
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio50 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio50
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio51 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio51
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio60 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio60
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio61 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpio61
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio65 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpio65
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio66 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpio66
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio67 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpio67
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio68 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpio68
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio69 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpio69
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpio7 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpio7
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpiochip0 ->
../../devices/platform/ocp/44e07000.gpio/gpio/gpiochip0
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpiochip32 ->
../../devices/platform/ocp/4804c000.gpio/gpio/gpiochip32
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpiochip64 ->
../../devices/platform/ocp/481ac000.gpio/gpio/gpiochip64
lrwxrwxrwx 1 debian debian 0 Apr 13 19:57 gpiochip96 ->
../../devices/platform/ocp/481ae000.gpio/gpio/gpiochip96
--w--w---- 1 debian debian 4.0K Apr 13 19:57 unexport

blinkled.js still fails...

Regards,

Hmmm… nothing in /etc/udev/rules.d. Looks like it didn’t install.

–Mark

That was it. gpio seems to be working now as debian. I’ll keep playing…

–Mark

I’ll ask about student support. If the student is directly supporting the class, I think it can be done. However if the student is supporting an outside project it get trickier.

Could we pay a student?

–Mark

Okay got gpio working and it's not locking up the serial port:

chown -R root:gpio /sys/class/gpio
chmod -R ug+rw /sys/class/gpio

https://github.com/RobertCNelson/boot-scripts/commit/dfd4241c909000837a1ebb7fb6c3d474def8e52f

and this udev rule:

https://github.com/rcn-ee/repos/blob/master/bb-bb-customizations/suite/jessie/debian/80-gpio-noroot.rules

Regards,