kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

Empty dirs in .cache/kiss/proc when not using KISS_DEBUG, randomly don't get deleted #259

Closed kyx0r closed 3 years ago

kyx0r commented 3 years ago

When performing sequence kiss b && kiss i and KISS_DEBUG being unset empty pid named dirs randomly don't get deleted resulting in useless clutter. Also confimed by GalaxyNova and testuser on irc.

dylanaraps commented 3 years ago

I cannot reproduce. Does it happen with specific packages or is it totally random?

konimex commented 3 years ago

I can confirm this. It's totally random. I think it might be related with kiss u?

kyx0r commented 3 years ago

Oh I think I know now, this confusion might be caused by doing something like this:

ki() { export KISS_PROMPT=0 && kiss b "$1" && kiss i "$1" && unset KISS_PROMPT; }

Because if prompt is disabled, kiss b will try to install package and fallthough and then another command kiss it will install it again. So obviously we can fix that shell function, however what is interesting, it creates 2 pid dirs in /proc and one of them will not get deleted for some reason and every dir inside will be empty.

So it turns out that kiss install leaves those junk directories behind when KISS_DEBUG=1 Perhaps it's the only problem, or maybe there are other reasons when sometimes kiss install gets bugged

dylanaraps commented 3 years ago

however what is interesting, it creates 2 pid dirs in /proc and one of them will not get deleted for some reason and every dir inside will be empty.

Two directories are created because two instances of the package manager are launched.

So it turns out that kiss install leaves those junk directories behind when KISS_DEBUG=1

Yes, this is intentional.

Perhaps it's the only problem, or maybe there are other reasons when sometimes kiss install gets bugged

I still cannot reproduce using your function. Your function ends up installing the package twice no? If you disable the prompt the package will be automatically installed after kiss b, you then run kiss i afterwards(?).

kyx0r commented 3 years ago

Yes I think in my case I just had a bugged function in my .rc because of blundering the fact that the package will be installed twice (which is wrong). But I don't know how other people are running into this problem.

dylanaraps commented 3 years ago

A log file (containing the failure to clean the cache) would be great if anyone is able to obtain one.

dylanaraps commented 3 years ago

What KISS_ environment variables do you have set by the way?

dylanaraps commented 3 years ago

Also, with these leftover directories who is the owner and what are the permissions? (ls -ld dir).

dilyn-corner commented 3 years ago

I can reproduce this issue. The directories are owned by me, none of the files inside exist (just the directories kiss makes),

/tmp/22190:
total 0
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 pkg
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 tmp

/tmp/22230:
total 0
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 pkg
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 tmp

/tmp/22347:
total 0
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 pkg
drwxr-xr-x 2 dilyn dilyn 40 2021-08-12 11:19 tmp

/tmp/24977:
total 0
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:06 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:06 extract
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:06 pkg
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:06 tmp

/tmp/24992:
total 0
drwxr-xr-x 3 dilyn dilyn 60 2021-08-11 01:06 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:06 extract
drwxr-xr-x 3 dilyn dilyn 60 2021-08-11 01:06 pkg
drwxr-xr-x 2 dilyn dilyn 80 2021-08-11 01:06 tmp

/tmp/2921:
total 0
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:10 build
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:10 pkg
drwxr-xr-x 2 dilyn dilyn 40 2021-08-11 01:10 tmp

and here are the variables I have set:

KISS_PATH=:/var/db/kiss/KISS-me/core:/var/db/kiss/KISS-me/extra:/var/db/kiss/KISS-me/wayland:/var/db/kiss/KISS-me/gpl
KISS_CHK=b3sum
KISS_TMPDIR=/tmp
KISS_SU=doas
KISS_COMPRESS=zst
KISS_HOOK=/home/dilyn/fossil/KISS-me/hooks

I'll see if I can find an obviously reliable way to reproduce this.

dylanaraps commented 3 years ago

If you can reproduce it reliably, a log file would be great.

git-bruh commented 3 years ago

This seems to happen when extensions are invoked via 'kiss cmd' instead of the real script 'kiss-cmd', like kiss fork

dylanaraps commented 3 years ago

Fixed. Thanks for finding the cause.

Edit: pushed a new release.