Description of problem: I find it very strange that log is saved in /usr/share/ovirt-engine/dbscripts as well as some other help files. /usr on UNIX systems holds static files. The log should be saved to some other location, helping files too. # find /usr/share/ovirt-engine/dbscripts -mtime 0 -exec sh -c '[ -d {} ] && ls -ld {} || ls -l {}' {} {} \; drwxr-xr-x. 4 root root 4096 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts drwxr-xr-x. 4 root root 20480 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts/upgrade drwxr-xr-x. 2 root root 4096 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade drwxr-xr-x. 2 root root 4096 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade -rw-r--r--. 1 root root 681862 Apr 2 09:23 /usr/share/ovirt-engine/dbscripts/.schema -rw-r--r--. 1 root root 19370 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts/.engine_2013_04_02_09_21_42.scripts.md5 drwxr-xr-x. 2 root root 4096 Apr 2 09:22 /usr/share/ovirt-engine/dbscripts/db_schema_version_check -rw-r--r--. 1 root root 7503150 Apr 2 09:23 /usr/share/ovirt-engine/dbscripts/upgrade.sh.log Version-Release number of selected component (if applicable): sf12 How reproducible: 100% Steps to Reproduce: 1. rhevm-upgrade 2. check for new files (see find command above) 3. Actual results: breaks usual unix filesystem habits Expected results: do it unix way Additional info:
Eli, Looking at dbfunctions.sh (and some other scripts), it looks like the scripts create the log/md5/.schema/etc file in the current running dir, without any option to set the log dir to a saner place (like /var or). Any chance I'm missing something? otherwise, it looks like a db/infra issue.
(In reply to comment #2) > Eli, > Looking at dbfunctions.sh (and some other scripts), it looks like the > scripts create the log/md5/.schema/etc file in the current running dir, > without any option to set the log dir to a saner place (like /var or). > > Any chance I'm missing something? otherwise, it looks like a db/infra issue. *.md5 , .schema are created at dbscripts and should remain as such The logfile location & name is controlled by the logfile can be set by using the -l LOGFILE parameter. The default value of the LOGFILE is set in dbscustomfunctions.sh
> *.md5 , .schema are created at dbscripts and should remain as such This is wrong, you can't create *ANY* new file in /usr/share, it violates the linux FHS. (A patch for the setup suppliny "-l" parameter to the upgrade script was pushed into http://gerrit.ovirt.org/13893, I'm moving this bug to infra team, as no files should be created in /usr/share)
Eli, The patch mentioned in comment #4 handles the log file location. How complicated is it to move the *.md5 , .schema files to a configurable (by commandline) location ? I understand other other scripts are using these files.
(In reply to comment #5) > Eli, > > The patch mentioned in comment #4 handles the log file location. > > How complicated is it to move the *.md5 , .schema files to a configurable > (by commandline) location ? It is not a question of how complicated, the md5 are used internally by the scripts and should not be exposed to the user and therefore should remain in dbscripts directory. The .schema is a auto-generated file that shows how the updated schema looks like , so , if you want to do a change, you can look in this file and see how your change affects the up-to-date database and therefore this file should remain in dbscripts as well. > > I understand other other scripts are using these files.
New patch : 1) Adding -g parameter to create_db.sh create_schema.sh and upgrade.sh to disable MD5 files generation (default NOMD5=false) 2) Adding -m MD5DIR parameter to create_db.sh create_schema.sh and upgrade.sh to set the MD% directory (default =MD5DIR=$(pwd)) 3) Removing auto-generation of .schema files and creating a exportDbSchema.sh that generates this file since it is used only for development
fixed in commit: 44ae2c8
Not exactly post, as packaging is not done yet. Alex, you should use these new parameters.
Verified on sf12 -> sf17: On sf12, clean install, the files, mentioned in the description, exist, and after upgrade to sf17, new ones were not generated: On sf-12 clean install: ---------------------- [root@istein-32 yum.repos.d]# find /usr/share/ovirt-engine/dbscripts -mtime 0 -exec sh -c '[ -d {} ] && ls -ld {} || ls -l {}' {} {} \; drwxr-xr-x 4 root root 4096 May 21 21:34 /usr/share/ovirt-engine/dbscripts drwxr-xr-x 2 root root 4096 May 21 21:29 /usr/share/ovirt-engine/dbscripts/db_schema_version_check -rw-r--r-- 1 root root 681591 May 21 21:34 /usr/share/ovirt-engine/dbscripts/.schema drwxr-xr-x 4 root root 20480 May 21 21:29 /usr/share/ovirt-engine/dbscripts/upgrade drwxr-xr-x 2 root root 4096 May 21 21:29 /usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade drwxr-xr-x 2 root root 4096 May 21 21:29 /usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade -rw-r--r-- 1 root root 19370 May 21 21:34 /usr/share/ovirt-engine/dbscripts/.engine.scripts.md5 -rw-r--r-- 1 root root 970783 May 21 21:34 /usr/share/ovirt-engine/dbscripts/create_db.sh.log [root@istein-32 yum.repos.d]# date Tue May 21 21:37:11 IDT 2013 After upgrade to sf17: --------------------- [root@istein-32 yum.repos.d]# find /usr/share/ovirt-engine/dbscripts -mtime 0 -exec sh -c '[ -d {} ] && ls -ld {} || ls -l {}' {} {} \; drwxr-xr-x 4 root root 4096 May 21 21:48 /usr/share/ovirt-engine/dbscripts drwxr-xr-x 2 root root 4096 May 21 21:48 /usr/share/ovirt-engine/dbscripts/db_schema_version_check -rw-r--r-- 1 root root 681591 May 21 21:34 /usr/share/ovirt-engine/dbscripts/.schema drwxr-xr-x 4 root root 20480 May 21 21:48 /usr/share/ovirt-engine/dbscripts/upgrade drwxr-xr-x 2 root root 4096 May 21 21:48 /usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade drwxr-xr-x 2 root root 4096 May 21 21:48 /usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade -rw-r--r-- 1 root root 19544 May 21 21:48 /usr/share/ovirt-engine/dbscripts/.engine_2013_05_21_21_47_36.scripts.md5 -rw-r--r-- 1 root root 19370 May 21 21:34 /usr/share/ovirt-engine/dbscripts/.engine.scripts.md5 -rw-r--r-- 1 root root 970783 May 21 21:34 /usr/share/ovirt-engine/dbscripts/create_db.sh.log [root@istein-32 yum.repos.d]# find / -name .schema /usr/share/ovirt-engine/dbscripts/.schema
3.2 has been released