Sunday, June 30, 2019

6.5 pkg_add "Fatal error: Can't write session into tmp directory"

I have 6.5/i386 installed on a PC Engines alix board (hostname 'sodium'),
acting as a home firewall and router. I'd like to install some packages
the firewall it to make system adminstration easier. So... I downloaded
the appropriate 6./i386 packages from a nearby OpenBSD mirror, ssh-ed them
to /tmp on the firewall, and then (logged into the firewall as root) tried
to pkg_add them. Alas, pkg_add failed with an error message about being
unable to write into a temp directory:

sodium# pkg_add -vv tcsh-6.20.00p1-static.tgz
Fatal error: Can't write session into tmp directory
at /usr/libdata/perl5/OpenBSD/PackageRepository.pm line 1025.
sodium#

I've checked that the firewall has adequate free memory & swap space,
that all the obviously-relevant filesystems are mounted read-write and
have free inodes and disk space, and that 'touch foo' can create a new
file in each of /tmp, /var/tmp, and /usr/tmp.

Is there something obvious I'm overlooked here? A Fine Man Page I should
be rereading before I start hacking debug prints into the pkg_add (perl)
source code?

Further information (cut-and-pasted from ssh session on the firewall):

sodium# uname -a
OpenBSD sodium.bkis-orchard.net 6.5 GENERIC#1 i386
sodium# df -hi
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/wd0a 378M 47.7M 311M 13% 1771 47379 4% /
mfs:54350 62.9M 2.0M 57.7M 3% 8 8182 0% /tmp
/dev/wd0e 677M 15.1M 628M 2% 352 87710 0% /var
/dev/wd0f 1.5G 698M 734M 49% 16248 191622 8% /usr
mfs:42325 62.9M 2.0K 59.7M 0% 1 8189 0% /usr/tmp
/dev/wd0g 516M 138M 352M 28% 8980 58602 13% /usr/X11R6
/dev/wd0h 1.7G 218K 1.6G 0% 110 233744 0% /usr/local
/dev/wd0j 5.1G 2.0K 4.8G 0% 1 701565 0% /usr/obj
/dev/wd0i 1.3G 2.0K 1.3G 0% 1 181885 0% /usr/src
sodium# cat /etc/fstab
5fd63b50b0c6cb1d.a / ffs rw,softdep,noatime 1 1
5fd63b50b0c6cb1d.d /tmp mfs rw,async,nodev,nosuid,-s=64m 0 0
5fd63b50b0c6cb1d.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2
5fd63b50b0c6cb1d.f /usr ffs rw,softdep,noatime,nodev 1 2
5fd63b50b0c6cb1d.d /usr/tmp mfs rw,async,nodev,nosuid,-s=64m 0 0
5fd63b50b0c6cb1d.g /usr/X11R6 ffs rw,softdep,noatime,nodev 1 2
5fd63b50b0c6cb1d.h /usr/local ffs rw,softdep,noatime,wxallowed,nodev 1 2
5fd63b50b0c6cb1d.j /usr/obj ffs rw,softdep,noatime,nodev,nosuid 1 2
5fd63b50b0c6cb1d.i /usr/src ffs rw,softdep,noatime,nodev,nosuid 1 2
sodium# top|head
load averages: 0.08, 0.02, 0.01 sodium.bkis-orchard.net 13:12:00
52 processes: 1 running, 50 idle, 1 on processor up 14 days, 5:21
CPU: 0.1% user, 0.0% nice, 0.3% sys, 0.0% spin, 0.3% intr, 99.3% idle
Memory: Real: 35M/110M act/tot Free: 127M Cache: 46M Swap: 0K/548M

PID USERNAME PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND
59735 root 10 0 0K 19M sleep bored 44:53 0.44% softnet
65312 root -22 0 0K 19M sleep - 339.9H 0.00% idle0
57981 root 10 0 0K 19M sleep bored 7:56 0.00% sensors
39371 _unbound 2 0 12M 10M sleep kqread 1:33 0.00% unbound
sodium# cd /tmp
sodium# ls -l
total 4144
drwxrwxrwt 2 root wheel 512 Jun 16 07:51 .ICE-unix
drwxrwxrwt 2 root wheel 512 Jun 16 07:51 .X11-unix
-rw-r--r-- 1 root wheel 1499861 Jun 30 12:31 lynx-2.8.9rel1.tgz
drwxr-xr-x 2 root wheel 512 Jun 16 07:51 sndio
-rw-r--r-- 1 root wheel 564428 Jun 30 12:31 tcsh-6.20.00p1-static.tgz
drwxrwxrwt 2 root wheel 512 Jun 30 12:33 vi.recover
sodium#
sodium# pkg_info
sodium#
sodium# which pkg_add
/usr/sbin/pkg_add
sodium# pkg_add -vv tcsh-6.20.00p1-static.tgz
Fatal error: Can't write session into tmp directory
at /usr/libdata/perl5/OpenBSD/PackageRepository.pm line 1025.
sodium# env
_=/usr/bin/env
LOGNAME=root
PWD=/tmp
HOME=/root
OLDPWD=/tmp
SSH_TTY=/dev/ttyp0
TOP=-S -i -s1
MAIL=/var/mail/root
SSH_CLIENT=192.168.105.0 4099 22
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
TERM=xterm
SHELL=/bin/ksh
SSH_CONNECTION=192.168.105.0 4099 192.168.105.62 22
USER=root
sodium# cd /tmp
sodium# touch foo
sodium# ls -l foo
-rw-r--r-- 1 root wheel 0 Jun 30 13:07 foo
sodium# /bin/rm foo
sodium#
sodium# cd /var/tmp
sodium# touch foo
sodium# ls -l foo
-rw-r--r-- 1 root wheel 0 Jun 30 13:08 foo
sodium# /bin/rm foo
sodium#
sodium# cd /usr/tmp
sodium# touch foo
sodium# ls -l foo
-rw-r--r-- 1 root wheel 0 Jun 30 13:13 foo
sodium# /bin/rm foo
sodium#

Thanks in advance for any assistance,
--
-- "Jonathan Thornburg [remove -animal to reply]" <jthorn@astro.indiana-zebra.edu>
Dept of Astronomy & IUCSS, Indiana University, Bloomington, Indiana, USA
currently on the west coast of Canada
"There was of course no way of knowing whether you were being watched
at any given moment. How often, or on what system, the Thought Police
plugged in on any individual wire was guesswork. It was even conceivable
that they watched everybody all the time." -- George Orwell, "1984"

No comments:

Post a Comment