This is not a bug, if there is a bug somewhere here, it is in ansible. Ansible should not try to parse the stdout or stderr of "service nginx status", it should check its exit code as Cyril suggested, that is the proper way to check that (He suggested it in bash, but it is documented in python as well).
Moreover, the nginx init script, if you take the time to look at it, is using the LSB function "status_of_proc" to report this message ... "could not access PID file for$name " is the output message suggested by the LSB. "The Linux Standard Base (LSB) is a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure." [Wikipedia] Asking to modify the LSB to ease your parsing might not be the shortest route here. Finally, from my point of view, "could not access PID file for nginx" is much more informative than "nginx is not running". I do prefer a process telling what test was actually done, than trying to infer what i want to deduce of the situation (there are many situation where nginx could be running but without any pidfile in /var/run, so while investigating i prefer a clear technical answer to an unsure approximation). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1023389 Title: "service nginx status" is confusing when nginx is not running To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1023389/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
