Dracut initqueue/finished question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I’m the main systemimager developer, a software aimed at image deployment in clients (main usage clusters)

I’ve rewritten systemimager using Dracut and a module to generate the initrd imager.
(https://github.com/finley/SystemImager/tree/initrd-from-imageserver-and-dont-package-initrd/lib/dracut/modules.d/51systemimager)

I need some clarification about how to tell the mainloop that I’ve finished my job.

As I understand, all scripts in /lib/dracut/hooks/initqueue/finished are sourced until they return 0

Unfortunately, my finished script, once I return 0 is still sourced a few times.
I see that btrfs module is doing exit 0, but If I’m correct, doing exit 0, will exit from /bin/initqueue (as the script is sourced (not run using a new shell))

So what should I do to tell Dracut hook I’m done?
1/ return 0
2/ exit 0
3/ rm $0 (rm initqueue as $0 is initqueue)
4/ rm /absolute/path/to/my/finish/script.sh ?

If solution is "return 0" how do I prevent multiple run when finished (when I'm done, I do some cleanup. Doing twice the cleanup can lead to errors so I need to prevent this finished to run twice if I've checked that I'm done)

Is the behavior the same on old Dracut (centos-6) and more recent Dracut (rhel-7/fedora-29)

Many thanks for clarification on that point.

Olivier.
-- 
Olivier LAHAYE
Systemimager developper.
 





[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux