PDA

View Full Version : Live build hook 0140 permission dennied error



Ksandro
2020-04-07, 05:36
I'm trying to build a custom ISO without the beep at boot. Just edited the menu.cfg file and followed the instructions from the oficial guide (https://www.kali.org/docs/development/live-build-a-custom-kali-iso/) but I keep getting the following error:
build.log


./usr/lib/live/config/0031-kali-password
[2020-04-06 23:27:13] lb chroot_hooks
P: Begin executing hooks...
/root/0140-remove-log-files.hook.chroot: 8: cannot create /var/log/postgresql/postgresql-12-main.log: Permission denied
E: config/hooks/normal/0140-remove-log-files.hook.chroot failed (exit non-zero). You should check for errors.
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...


I've tried running the 0140-remove-log-files.hook.chroot as a regular user and as a root but still getting the same error. Tried chown the postgresql-12-main.log file to the give the regular user ownership but stil no luck. Also tried running the script in bin/bash and the error is the same.

uname -a

Linux kali 5.4.0-kali4-amd64 #1 SMP Debian 5.4.19-1kali1 (2020-02-17) x86_64 GNU/Linux

Any help on how to proceed or fix this would be appreciated!

uzy
2020-04-16, 01:30
I'm trying to build a custom ISO without the beep at boot. Just edited the menu.cfg file and followed the instructions from the oficial guide (https://www.kali.org/docs/development/live-build-a-custom-kali-iso/) but I keep getting the following error:
build.log


I've tried running the 0140-remove-log-files.hook.chroot as a regular user and as a root but still getting the same error. Tried chown the postgresql-12-main.log file to the give the regular user ownership but stil no luck. Also tried running the script in bin/bash and the error is the same.

uname -a


Any help on how to proceed or fix this would be appreciated!

The problem comes from the sticky bit set on the /var/log/postgresql dir.

This doesn't work even if we are running as root :

: > postgresql-12-main.log

This would work:

truncate -cs 0 postgresql-12-main.log

MestreYoda
2020-05-02, 17:49
I am currently facing the same error. Can anyone shed light on this problem?