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
Sorry, I forget the version: rhv-log-collector-analyzer-0.1.6-0.el7ev.noarch
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!
Yes, that works.
According the workaround, it would be enough to mention it in --help and manpage. Something like: To change temporary directory use 'export TMPDIR=/foo'.
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.