Bug 1643491

Summary: mention how to change temporary directory for rhv-log-collector-analyzer in help and manpage
Product: Red Hat Enterprise Virtualization Manager Reporter: Lucie Leistnerova <lleistne>
Component: rhv-log-collector-analyzerAssignee: Douglas Schilling Landgraf <dougsland>
Status: CLOSED CURRENTRELEASE QA Contact: Ivana Saranova <isaranov>
Severity: high Docs Contact:
Priority: high    
Version: 4.2.7CC: lleistne, mtessun
Target Milestone: ovirt-4.3.1Keywords: Automation, FieldEngineering
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhv-log-collector-analyzer-0.1.9-0.el7ev Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-31 08:54:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lucie Leistnerova 2018-10-26 11:32:11 UTC
Description of problem:
Analyzer tool generates his scripts in /tmp temporary directory and when /tmp is mounted with noexec flag, the tool fails on Permission denied when running as postgres user.

Version-Release number of selected component (if applicable):


How reproducible: always

Steps to Reproduce:
1. mount /tmp with noexec e.g. in fstab:
/dev/mapper/ovirt-tmp   /tmp                    xfs     nodev,noexec,nosuid 0 0
2. run ovirt-log-collector
4. run rhv-log-collector-analyzer with generated sosreport as postgres user

Actual results: 
Creating a temporary database in /tmp/tmp.41ojor8HmH/postgresDb/pgdata. Log of initdb is in /tmp/tmp.41ojor8HmH/initdb.log

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
/usr/share/ovirt-log-collector/analyzer/importDumpIntoNewDb.sh: line 55: /tmp/tmp.41ojor8HmH/startDb.sh: Permission denied



Expected results: /tmp dir for temporary directory can be changed with some parameter

Comment 1 Lucie Leistnerova 2018-10-26 11:33:43 UTC
Sorry, I forget the version:
rhv-log-collector-analyzer-0.1.6-0.el7ev.noarch

Comment 3 Douglas Schilling Landgraf 2018-10-29 17:35:56 UTC
Hi Lucie,

rhv-log-collector-analyzer uses the TMP dir set from OS env. 

Could you please try:

$ export TMPDIR=/foobar
$ rhv-log-collector-analyzer sosreport.tar.xz

Please let me know the results.

Thanks!

Comment 4 Lucie Leistnerova 2018-10-30 13:49:04 UTC
Yes, that works.

Comment 5 Lucie Leistnerova 2018-10-31 15:25:11 UTC
According the workaround, it would be enough to mention it in --help and manpage.
Something like:

To change temporary directory use 'export TMPDIR=/foo'.

Comment 9 Ivana Saranova 2019-02-15 15:30:31 UTC
According to the comments, I verified that both --help and manpage mention how to use another tmp directory in case user can't use the default one.

Verified in:
ovirt-engine-4.3.0-0.8.rc2.el7.noarch
rhv-log-collector-analyzer-0.2.3-0.el7ev.noarch

Steps:
1. See if --help mentions it:

rhv-log-collector-analyzer --help

2. See if manpage mentions it:

man rhv-log-collector-analyzer 


Results:

[root@engine ~]# rhv-log-collector-analyzer --help
Usage: /usr/bin/rhv-log-collector-analyzer [options] <tar-file>
    --postgres-db-user
        Postgres username for database connection (only required for remote database)
    --postgres-db-address
        Postgres database address (only required for remote database)
...
Script unpacks sosreport, import it into db and generates html report into current directory.
To change temporary directory use: export TMPDIR=/my-tmp-dir


[root@engine ~]# man rhv-log-collector-analyzer
...
       EXAMPLES
              Analyze based on Live System
              $ rhv-log-collector-analyzer --live
              $ rhv-log-collector-analyzer --live --json

              Analyze based on Sosreport
              NOTE:  To change temporary directory use: export TMPDIR=/my-tmp-
              dir
              $ sudo su postgres && cd /tmp
              $ rhv-log-collector-analyzer sosreport-foo-bar.tar.xz


If you think this is not enough, please feel free to reopen this.