0

I'm using centos 6 - recently I am getting this error anything I want to install anything on server for example with varnish - var/tmp is empty and has root:root as owner i have checked with 777 permission on var/tmp directory but still same error -

Also checked if it was related to systemd using below command -- but results showing other

pidof systemd && echo "systemd" || echo "other"

error is below

Total download size: 2.2 M
Installed size: 8.1 M
Is this ok [y/N]: y
Downloading Packages:
varnish-5.2.1-1.el6.x86_64.rpm                                               
| 2.2 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
error: error creating temporary file /var/tmp/rpm-tmp.cNUXgY: No such file or directory
error: Couldn't create temporary file for %pre(varnish-5.2.1-1.el6.x86_64): No such file or directory
Error in PREIN scriptlet in rpm package varnish-5.2.1-1.el6.x86_64
error:   install: %pre scriptlet failed (2), skipping varnish-5.2.1-1.el6
  Verifying  : varnish-5.2.1-1.el6.x86_64                                                       
1/1

Failed:
  varnish.x86_64 0:5.2.1-1.el6
James Sneeringer
  • 6,835
  • 24
  • 27
jt9489
  • 11
  • 1
  • 5
  • 4
    Never chmod 777 anything for any reason. There is no good reason to ever use this command. This is much too destructive. In the case of a temporary directory, it will just stop working properly. – Michael Hampton Aug 19 '20 at 15:39
  • 1
    CentOS 6 doesn't use or have systemd. Not finding a pid for it is expected. –  Aug 19 '20 at 16:12
  • `/var/tmp` should be mode 1777 (with the sticky bit set). What does `ls -ld /var/tmp` show? Also, please show us the preinstall script being run by the package: `rpm -qp --scripts varnish-5.2.1-1.el6.x86_64.rpm`. – James Sneeringer Aug 19 '20 at 16:50

1 Answers1

1

The correct permissions for /var/tmp would be "1777". Only "777" does not set the sticky bit which could be part of the issue.

Could you check if "mktemp -d --tmpdir=/var/tmp rpm-tmp.XXXXXX" is working? This is to test if creating a temp directory is working at all. Secondly you could try to disable SELinux temporarily. Maybe RPM is changing some context internally and therefore is not allowed to created directories.

If that doesn't help we would need more information:

  • how do you install the package?
  • does it work for other packages?
  • system setup
  • recent changes, did it work before those changes?
C.B.
  • 21
  • 5
  • 1. have tried with 1777 permission aswell for both tmp and var/tmp 2. mktemp -d --tmpdir=/var/tmp rpm-tmp.XXXXXX is giving output /tmp/ci-REI2MPBNPl - SELinux is enabled i have set to disable - running sudo setenforce 0 - but after checking it still showing as enabled - in permissive mode. – jt9489 Aug 19 '20 at 17:14
  • Installing packages via command line bitvise as root user - it doesnt work for other packages - system has centos 6 + apache and nginx 16gb ram -- i have only realised this issue today maybe it happened before - but i have been able to install previously just that i havent had to install anything for long time - only issue was with a server power outage and it was fixed by hosting and rebooted – jt9489 Aug 19 '20 at 17:19
  • You can disable SELinux from the configuration. This way it's disabled for everything. Could you also check if /var/lib is a separate file system and if yes how it's mounted? Maybe it's mounted readonly. Just a wild guess. – C.B. Aug 19 '20 at 17:21
  • tried disabling from configuration file as mentioned - but doesnt fix issue - [Home]/var/lib/ and has 0755 please can you clarify what you mean by how its mounted – jt9489 Aug 19 '20 at 17:58
  • D'oh, I meant /var/tmp in my last answer, not /var/lib. Sorry for that. Check with "df" if /var/tmp appears as a separate filesystem. If yes then run "mount" (without options) and find the line which represents the mount point. There you find the mount options. – C.B. Aug 19 '20 at 18:07
  • thanks i checked using findmnt got output like this ├─/home /dev/mapper/vg_is74154-lv_home └─/var/tmp (deleted) /dev/mapper/vg_is74154-lv_root[/tmp//deleted] – jt9489 Aug 19 '20 at 18:31
  • running df doesn't show it being separate file system – jt9489 Aug 19 '20 at 18:49
  • This "(deleted)" hint from findmnt is weird. Especially as it is also noted for lv_root. This points to some problem with your LVM. Unfortunately I don't have a machine with LVM at hand to reproduce this. You should check your LVM setup, especially if the LV root_fs is ok. Did you add/remove/modify volumes lastly? – C.B. Aug 19 '20 at 19:10
  • LV is looking ok - can this be permission or configuration issue tried lots of different things but nothing is fixing this issue – jt9489 Aug 19 '20 at 22:38
  • To be honest it's hard to tell without seeing the system. Try adding all information about your LVM setup, everything we found in the last hours and all changes you tried to fix it into your question. Maybe some other people have ideas then. – C.B. Aug 19 '20 at 23:17
  • i just tried install of some .rmp and it got completed so it must be some issue it has with installing varnish using epel - i have done it in past without issue but dont understand why it doesnt install now – jt9489 Aug 19 '20 at 23:32
  • it wont let me uninstall epel aswell showing same error couldnt create a temporary file for error – jt9489 Aug 19 '20 at 23:34