troglobit / finit

Fast init for Linux. Cookies included
https://troglobit.com/projects/finit/
MIT License
634 stars 63 forks source link

Mounting filesystems from /etc/finit "OK" even though mount call fails #400

Closed mandelmassa closed 7 months ago

mandelmassa commented 8 months ago

Hi, i noticed an issue where our HOOK_MOUNT_ERROR plugin was not being called even though I explicitly destroyed one of the partitions listed in /etc/fstab, making mount -na fail with this log:

mount: /settings: wrong fs type, bad option, bad superblock on /dev/mmcblk0p5, missing codepage or helper program, or other error.

I believe I've traced it down to the function run in exec.c, where the return value from pclose is used directly in the call to _exit. using _exit(WEXITSTATUS(rc)) gives the expected behaviour.

troglobit commented 8 months ago

Ouch, nice catch! I'll have a look at it (reproduce and fix).

mandelmassa commented 7 months ago

I've verified your fix, it works as intended on our system now! Thanks!

troglobit commented 7 months ago

I've verified your fix, it works as intended on our system now! Thanks!

Great, thank you for checking and taking the time to report back!