mesosphere/deimos — pull request #17 by onejli (2014-06-17 01:03:40+00:00)
Title: chmod +x *.py files to match perms as set during the packaging process

From an earlier email chain:
> I think the failure is here in the observer process (https://gist.github.com/onejli/1fa43cf2615d138d6324#file-syslog-L150) which eventually sends signal 134 (aborted) and exits 0 (https://gist.github.com/onejli/1fa43cf2615d138d6324#file-syslog-L203). Within mesos-executor, https://github.com/apache/mesos/blob/0.19.0/src/exec/exec.cpp#L299 invokes launchTask which eventually aborts https://github.com/apache/mesos/blob/0.19.0/src/launcher/executor.cpp#L192.
>
> The command it's trying to run is here https://gist.github.com/onejli/1fa43cf2615d138d6324#file-deimos-tmp-L51. Running it on my physical host, I see where the error arises:
> ```
$ /home/mesos/deimos/deimos/__init__.py wait @@observe-docker@@ 8cdc82785820b2c167ad610913dd2486bffa147b8ac4299786bf1a9fed34312f
-su: /home/mesos/deimos/deimos/__init__.py: Permission denied
```
>
> It's a perm issue. My checkout from github has u+rw (but not +x) on all `*.py` files. Since all the other invocations of demios by mesos are via that bin/deimos stub (which explicitly declares the python interpreter), this issue didn't come up earlier. I'm thinking it might best to change the invocation of deimos to the "proper" binary instead of `__init__.py` on this line https://github.com/mesosphere/deimos/blob/0.3.1/deimos/containerizer.py#L138.

This PR takes a slightly different approach than what was mentioned in my above snippet and updates the file perms to match what the packager "does" instead of using the path to the deimos binary passed to the Mesos slave (i.e. `--containerizer_path=/usr/local/bin/deimos`).