Question

We have a command and control daemon running under Fedora 16 that provides various services, including starting one of our ancillary applications. This has been working for us for quite some time.

In fact it still works - on some systems.

The daemon process forks (successfully) and then calls execv().

Setting up on another system to test, I suddenly have a failure, and execv() fails and returns 127.

Both systems are running Fedora 16, although the one with the problem is 3.3.7-1.fc16.x86_64 whereas another where everything works fine is running 3.4.2-1.fc16.x86_64

If I stop the daemon and run it as a stand-alone application, the whole process works fine.

All searching through documentation on execv() and related fails to bring up a 127 error code, my only guess so far is the Linux 'Command not found' error. Not knowing what it means is making it hard to fix the problem.

Can anybody tell me what the 127 return code means?

Thanks!

Was it helpful?

Solution

Ok, the problem came back and I found that I had actually solved it, but that the solution took some time to work.

A particular library that seems to have been picked up by on other systems (possibly because the library was loaded as part of a driver for some hardware that's missing on the errant machine) was not being found by the dynamic linker.

Adding it to a config file in /etc/ld.so.conf.d/ didn't immediately help, but a few hours later and after a few reboots it did.

So: execv() didn't launch an application, and instead returned 127 as a symptom of not finding a library.

the solution was to add the path to an appropriate file in /etc/ld.so.conf.d/

For immediate satisfaction, run ldconfig to rebuild the cache.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top