Details
Description
When a state script logs anything to stderr, the client reports :
ERRO[0075] stderr collected while running script /var/lib/mender/scripts/script
As the purpose of stderr is to log error and diagnostic messages, it doesn't necessarily mean an error occurred when there is something in stderr.
References (because the stream name is misleading and some people don't believe it's also for diagnostics):
- https://en.wikipedia.org/wiki/Standard_streams
- https://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
The client should rather check if an error occurred by reading the return code of the script.
Related : MEN-1349