-
assigned issue to
Command line arguments are not positionally independent
Issue #51
resolved
When testing the syntax of a custom control file, "monit" errors out if the "-t" option goes before the "-c" option with a file name:
$ ./monit/bin/monit-linux-x86 -t -c ./monit/conf/monitrc
Cannot find the control file at ~/.monitrc, /etc/monitrc, /uadev/attprod/smaslyak/monit/linux-x86/monit/etc/monitrc, /usr/local/etc/monitrc or at ./monitrc
If I reverse the order of the arguments, it works fine:
$ ./monit/bin/monit-linux-x86 -c ./monit/conf/monitrc -t
Generated unique Monit id e10354d234a32101c1be335e47aeab29 and stored to '/home/smaslyak/tmp/monit-poc/monit/var/.monit.id'
Control file syntax OK
Comments (5)
-
repo owner -
repo owner Fix Issue
#51→ <<cset d5ebffc56b5b>>
-
repo owner - changed component to 1. Monit
-
repo owner - changed component to Monit
-
repo owner - removed version
Removing version: 5.8.1 (automated comment)
- Log in to comment
Confirmed. When -t -r or -i are used, handle_options runs do_init at once without considering later arguments such as -c control-file. The code is much simplified by doing it like this, but usability suffer and we agree that arguments should be position independent. It is a drag to change the code, but actions when given the above arguments need to be deferred to make sure any control file given are read first and used.