Description of problem: getopt(1) shell command has the following optional argument defined in man page [1] . . . -n, --name progname The name that will be used by the getopt(3) routines when it reports errors. Note that errors of getopt(1) are still reported as coming from getopt. . . . The way getopt shell command is used inside almost every hook scripts results is generating wrong script name while reporting any errors during execution of `getopt`. Version-Release number of selected component (if applicable): mainline [1] http://man7.org/linux/man-pages/man1/getopt.1.html
REVIEW: https://review.gluster.org/18548 (extras/hooks: Fix getopt usage) posted (#1) for review on master by Anoop C S (anoopcs)
We also have the following errors from hook scripts: ame: unrecognized option '--first=no' ame: unrecognized option '--version=1' ame: unrecognized option '--volume-op=start' Hook scripts fail to honour every command line arguments with which they are invoked.
REVIEW: https://review.gluster.org/18548 (extras/hooks: Fix getopt usage) posted (#2) for review on master by Anoop C S (anoopcs)
REVIEW: https://review.gluster.org/18569 (extras/hooks: Honour all input arguments to scripts) posted (#1) for review on master by Anoop C S (anoopcs)
REVIEW: https://review.gluster.org/18548 (extras/hooks: Fix getopt usage) posted (#3) for review on master by Anoop C S (anoopcs)
REVIEW: https://review.gluster.org/18569 (extras/hooks: Honour all input arguments to scripts) posted (#2) for review on master by Anoop C S (anoopcs)
COMMIT: https://review.gluster.org/18548 committed in master by ------------- extras/hooks: Fix getopt usage `getopt` does not have an optional argument as '-name'. It should be either '-n' or '--name'(see man getopt(1)). This wrong usage resulted in setting the script name as 'ame' instead of $PROGNAME in most of the hook-scripts. Additionally the following line from DESCRIPTION given for `getopt` shell command expects short options for almost every kind of usage mentioned in SYNOPSIS: . . . If no '-o' or '--options' option is found in the first part, the first parameter of the second part is used as the short options string. . . . Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more clarity on its usage. Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce BUG: 1503983 Signed-off-by: Anoop C S <anoopcs>
COMMIT: https://review.gluster.org/18569 committed in master by ------------- extras/hooks: Honour all input arguments to scripts Some of the hook scripts were not honouring the arguments with which they are invoked during various volume operations. So make sure that we consider everything while parsing the command line arguments to avoid following warnings: . . . ame: unrecognized option '--first=no' ame: unrecognized option '--version=1' ame: unrecognized option '--volume-op=start' . . . Change-Id: I5b08e5e7f32908c8509e97098a042096b507783e BUG: 1503983 Signed-off-by: Anoop C S <anoopcs>
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.13.0, please open a new bug report. glusterfs-3.13.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] http://lists.gluster.org/pipermail/announce/2017-December/000087.html [2] https://www.gluster.org/pipermail/gluster-users/