troglobit / finit

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

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

Closed mandelmassa closed 3 months ago

mandelmassa commented 3 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 3 months ago

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

mandelmassa commented 3 months ago

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

troglobit commented 3 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!