On 14Oct2015 16:31, Ian Collier <ian.coll...@cs.ox.ac.uk> wrote:
On Tue, Oct 13, 2015 at 01:51:31PM -0500, David Champion wrote:
The return from python's os.system is not the same as the exit status.
You need os.WEXITSTATUS(os.system(command)), which should be 0, or
success.

Although this is system-dependent, one popular implementation has:

#define __WEXITSTATUS(status)   (((status) & 0xff00) >> 8)

I'm pretty sure that is portable across UNIXen. Counter examples welcome to correct my knowledge.

so if system() returned 256 then the exit code was most likely 1, or failure.

Yep.

However, this does not tell you why it failed - need to look elsewhere
for that.

Mathieu replied to me directly, off list, by accident I think. I've asked if he'd like to come back on list. He's traced his issue to running his daemon from a boot script where $HOME isn't what he expected. I'm hoping to discuss that further on list after he replies.

Cheers,
Cameron Simpson <c...@zip.com.au>

I have seen all the works that are done under the sun;
and, behold, all is vanity and vexation of spirit.

Reply via email to