I'm trying to write a unit file for my CoreOS (version 1185.5.0) instance running on Google Compute Engine. However, it involves invoking gcloud via /usr/bin/sh, e.g. /usr/bin/sh -c 'gcloud --version'. The problem I face then is that /usr/bin/sh doesn't find gcloud: /usr/bin/sh: gcloud: command not found. I don't know why, as gcloud is available to me in my login shell.
Basically, how do I ensure that /usr/bin/sh can run gcloud?
Edit:
which doesn't find gcloud in my login shell either:
$ which gcloud
which: no gcloud in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin)
Figure out where
gcloudis (viawhich gcloud), and give the full path in/bin/shinvocations.For example: