Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
6.2.4
-
None
Description
When maxctrl fails to run a command, it prints an error message (and sets the exit code to be greater than zero).
In Unix (and hence Linux), each process has two output file descriptors: Standard Output (stdout) and Standard Error (stderr). The purpose of the first is to get common messages from the program - e.g., notices, information etc. The purpose of the second is to specifically get only error messages. This convention is important as many tools that may call a program will check its exit code and, if greater than zero, will log its Standard Error only.
maxctrl does not comply with these rules as it always prints its messages, even error messages, to stdout (on the Linux shell file descriptors are assigned integers for convenience, with 1 being stdout and 2 being stderr):
[root@p2w4 ~]# maxctrl lala > stdout 2>stderr; echo $?
|
1
|
[root@p2w4 ~]# ls -l
|
total 4
|
-rw-r--r--. 1 root root 0 Jun 23 20:16 stderr
|
-rw-r--r--. 1 root root 23 Jun 23 20:16 stdout
|
[root@p2w4 ~]# cat stdout
|
Unknown argument: lala
|
[root@p2w4 ~]# cat stderr
|
[root@p2w4 ~]#
|
This issue likely affects all versions of maxctrl since its introduction as a replacement to maxadmin.