YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

[#338] Fix various issues in ydbinstall script #339

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

1) The script now issues an error when an option has been specified with no value following it. For example, ydbinstall.sh --installdir --utf8 default. In this case, --installdir needs to be followed by a directory name but that was missed out in the specification. Previously, --utf8 (because that parameter immediately follows --installdir in the command line) was assumed to be the directory where the install was desired and this led to confusing results.

2) If a relative path is specified as the install directory name, the script now creates a subdirectory under the current directory at the time when the script was invoked and installs YottaDB there. Previously, it used to install YottaDB in a subdirectory under /tmp, later remove the entire directory and yet confusingly display a message indicating the install was successful.

3) If the configure script (that ydbinstall internally invokes) fails in determining the effective userid using the geteuid executable (say because libelf.so is not found etc.), it used to exit with an exit status of 0 back to its caller ydbinstall. This caused the latter to incorrectly conclude the install is successful when actually it was not. This is now fixed by exiting with a non-zero status at that point.

4) While fixing (3), it was determined that the effective user id check is done by both ydbinstall and configure separately. The former uses "id -un" whereas the latter uses "geteuid" executable. The sole purpose of the geteuid executable was this use in configure. This is therefore now replaced with a "id -un" check just like in ydbinstall. And as a result geteuid is now removed from the code base and YottaDB distribution.

5) While analyzing (3), it was helpful to enable verbose mode inside the configure script when invoked from ydbinstall. Since all the verbose output goes to a temporary file (configure.out and configure.err) and is not seen by the user in case of success, but is very helpful in case of errors, this change ("sh -x configure.sh" invocation) is therefore retained permanently.