Notice "binary operator expected" on update MariaDB Centos 8

Richard G

Verified User
Joined
Jul 6, 2008
Messages
13,529
Location
Maastricht
On MariaDB update on a Centos 8 machine I've just seen this passing by.
Code:
/var/tmp/rpm-tmp.8BC0jT: line 6: [: is-active: binary operator expected
"/var/tmp" already exists and is not a directory.

I do know that /var/tmp is indeed not a directory but a symlink to /tmp.
Upgrade seems to work fine so probably nothing to worry about, but I'm just curious anyway, I don't like seeing odd errors or notices.

The file rpm-tpm8bC0jT in /var/tmp was already gone again after the MariaDB update so no clue as to where this comes from or what it means.
Didn't see it (as far as I know) on the Centos 7 servers MariaDB upgrade.

Anybody?
 
I got notice too
but I don't have any log ""/var/tmp" already exists and is not a directory."
 
replace symlink by bind mount, in fstab it will look like:
/tmp /var/tmp none bind 0 0
or
/tmp /var/tmp none rw,noexec,nosuid,nodev,bind 0 0
 
@Zhenyapan I secured my /tmp like I always do on servers and I have this in my /etc/fstab

/var/tmpMnt /tmp ext4 loop,noexec,nosuid,nodev,rw 0 0

That because I create a file /var/tmpMnt (was 5 GB now I use 10 GB) and mount that as /tmp with chmod 1777. Got a procedure for that.

I always do it like this:
First secure /dev/shm:
in /etc/fstab change:
none /dev/shm tmpfs defaults,rw 0 0
to
none /dev/shm tmpfs defaults,nosuid,noexec,rw 0 0
and run
mount -o remount /dev/shm

Then i secure /tmp
Code:
dd if=/dev/zero of=/var/tmpMnt bs=1024 count=5000000
mkfs.ext4 -j /var/tmpMnt
cd /
cp -a /tmp /tmp_backup
rm -rf /tmp/.??* /tmp/*
mount -o loop,noexec,nosuid,nodev,rw /var/tmpMnt /tmp
chmod 1777 /tmp
cp -a /tmp_backup/.??* /tmp_backup/* /tmp/
rm -rf /tmp_backup
echo "/var/tmpMnt   /tmp   ext4   loop,noexec,nosuid,nodev,rw   0   0" >> /etc/fstab
cp -a /var/tmp/.??* /var/tmp/* /tmp
rm -rf /var/tmp
ln -s /tmp /var/tmp
cp -a /home/tmp/.??* /home/tmp/* /tmp
rm -rf /home/tmp
ln -s /tmp /home/tmp

Then I have a separate /da_tmp for directadmin chmod 777 which I point to from directadmin.conf.
Sometimes /var/tmp is not removable, then I have to stop some services and then it can be done.
 
Back
Top