APK: suspect remaining artifact in build, I have "/run/run"?

Hi,

After updating I found a path /run/run which cannot be right can it ? I was unsure if I should have posted this under developers, but I thought this was more fitting.

First things, first: I'm currently on:

# grep RELEASE /etc/os-release
OPENWRT_RELEASE="OpenWrt SNAPSHOT r28243-41f7322853"

I suspect there is a remaining build artifact /rom/run/apk/db.lock.

# find /rom/run -exec ls -ld {} \;
drwxr-xr-x    3 root     root            26 Dec  2 19:30 /rom/run
drwxr-xr-x    2 root     root            30 Dec  2 19:30 /rom/run/apk
-rw-------    1 root     root             0 Dec  2 19:30 /rom/run/apk/db.lock

It should be link according to /etc/init.d/boot

# grep run /etc/init.d/boot
        mkdir -p /var/run
        ln -s /var/run /run
        ln -s /var/lock /run/lock
#

but its not

# ls -ld /run
drwxr-xr-x    1 root     root          3488 Dec  5 07:01 /run
# ls -ld /rom/run
drwxr-xr-x    3 root     root            26 Dec  2 19:30 /rom/run
1 Like

Can you check the APK version?
Just run apk, and then you will see apk-tools 3.0.0_pre

Any chance you know what the previous version was, as I did push an update couple of days ago

# apk | grep ^apk-tools
apk-tools 3.0.0_pre20241113, compiled for aarch64.
#

Its present there too:

# mount | grep loop
/dev/loop0p1 on /media/test/kernel type ext4 (ro,nosuid,nodev,relatime,uhelper=udisks2)
/dev/loop0p2 on /media/test/disk type squashfs (ro,nosuid,nodev,relatime,errors=continue,uhelper=udisks2)
# cd disk
# find ./run -exec ls -ld {} \;
drwxr-xr-x 3 root root 26 Nov 28 22:33 ./run
drwxr-xr-x 2 root root 30 Nov 28 22:33 ./run/apk
-rw------- 1 root root 0 Nov 28 22:33 ./run/apk/db.lock
# cat etc/os-release
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r28214-5a4eb56a7b"
OPENWRT_BOARD="rockchip/armv8"
OPENWRT_ARCH="aarch64_generic"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r28214-5a4eb56a7b"
OPENWRT_BUILD_DATE="1732829601"

Also in 24th:

# mount | grep loop
/dev/loop0p1 on /media/test/kernel type ext4 (ro,nosuid,nodev,relatime,uhelper=udisks2)
/dev/loop0p2 on /media/test/disk type squashfs (ro,nosuid,nodev,relatime,errors=continue,uhelper=udisks2)
# cd disk
# find ./run -exec ls -ld {} \;
drwxr-xr-x 3 root root 26 Nov 21 22:04 ./run
drwxr-xr-x 2 root root 30 Nov 21 22:04 ./run/apk
-rw------- 1 root root 0 Nov 21 22:04 ./run/apk/db.lock
# cat etc/os-release 
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r28146-52b6c92479"
OPENWRT_BOARD="rockchip/armv8"
OPENWRT_ARCH="aarch64_generic"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r28146-52b6c92479"
OPENWRT_BUILD_DATE="1732223081"
# 

Not in Nov 1st:

# mount | grep loop
/dev/loop0p1 on /media/test/kernel type ext4 (ro,nosuid,nodev,relatime,uhelper=udisks2)
/dev/loop0p2 on /media/test/disk type squashfs (ro,nosuid,nodev,relatime,errors=continue,uhelper=udisks2)
# cd disk
# find ./run -exec ls -ld {} \;
find: ‘./run’: No such file or directory
# cat etc/os-release 
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r27981-cdc607d535"
OPENWRT_BOARD="rockchip/armv8"
OPENWRT_ARCH="aarch64_generic"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r27981-cdc607d535"
OPENWRT_BUILD_DATE="1730309000"
# 

Its then gotta only be happening after:

It seems as expected basically

Its not in the 21st, so its gotta be between 21st and 24th

edit:
I made a mistake, the file from 21st was from 2023 not even the right build :crazy_face:
So its still 1st-24th

The link creation fails because /run is present as a directory. So it creates the link inside the directory instead. Then we end up with /run/run

Going into a meeting, back in an hour or so :grin:

And we're back:

So 21st - 24rd, that could not be too many of them:

#git log --oneline | awk '/eed39d4/{flag=1;next}/03eeeff/{flag=0}flag' | wc -l
52
#

These mention APK:

  • fc2ba10108 include/package-pack: add support for postrm with APK
  • 5b6f8353fe include/package-pack: actually call default_postinist/prerm when using APK

I doubt those 2 are the causes, all they do is make the install/deinstall scripts work

I made a mistake in post8, the commit window is between 1st-24th.

Noted.

Correct me if I'm wrong, but the lock file is generated to ensure only one instance is running and is cleaned up after. Assuming it cannot be removed during, I suspect some process kept it open and cleanup fails.

Then its gotta be due to:

As that added the symlink