[Bug 1195850] New: installation hooks are not working
http://bugzilla.opensuse.org/show_bug.cgi?id=1195850 Bug ID: 1195850 Summary: installation hooks are not working Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Installation Assignee: yast2-maintainers@suse.de Reporter: comes@naic.edu QA Contact: jsrain@suse.com Found By: --- Blocker: --- I'm trying to use hooks as described here: https://github.com/yast/yast-yast2/blob/master/library/general/doc/Hooks.md What I did is to create the file "before_copy_logs_finish_00_test_hook.sh" and put it in var/lib/YaST2/hooks/installation in the 'root' image that is used at installation time (to be clear like the one that is available in: download.opensuse.org/tumbleweed/repo/oss/boot/x86_64/root At the the end of the installation process, the script before_copy_logs_finish_00_test_hook.sh is supposed to be executed, but that doesn't happen. The log /var/log/YaST2/y2log-1.gz explains why: [Ruby] modules/Hooks.rb(find_hook_files):193 Found 1 hook files: before_copy_logs_finish_00_comes_hook.sh [Ruby] modules/Hooks.rb(execute):165 Executing hook 'before_copy_logs_finish' [Ruby] modules/Hooks.rb(execute):210 Executing hook file '/var/lib/YaST2/hooks/installation/before_copy_logs_finish_00_comes_hook.sh' [bash] ShellCommand.cc(shellcommand):78 sh: /var/lib/YaST2/hooks/installation/before_copy_logs_finish_00_comes_hook.sh: No such file or directory [Ruby] modules/Hooks.rb(execute):212 Hook file 'before_copy_logs_finish_00_comes_hook.sh' failed with stderr: sh: /var/lib/YaST/hooks/installation/before_copy_logs_finish_00_comes_hook.sh: No such file or directory The installer finds the script, but when it is executed it is not there. I suspected a chroot issue and to confirm my suspicion I did the following: After the installation process started, I moved to tty2 where a shell is available. The command 'ls /var/lib/YaST2/hooks/installation' shows that the hook script is there. then I did: mkdir -p /mnt/var/lib/YaST2/hooks/installation cp /var/lib/YaST2/hooks/installation/* /mnt/var/lib/YaST2/hooks/installation and let the installation process complete. This time the hook script got executed. The solution to the problem seemd to be: 1) do not execute the hook scripts in the chroot environment or 2) make the hook scripts visible in the chroot environment I guess the correct solution is number 2. For the record, the issue exists both in Leap 15.3 and tumbleweed. Using hooks was a possible solution to fix boo#1195118 bur I guess that's not an option right now. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1195850 http://bugzilla.opensuse.org/show_bug.cgi?id=1195850#c4 --- Comment #4 from Giacomo Comes <comes@naic.edu> --- One year has passed and nothing seems to have happened about this bug. I decided to have a deeper look at the problem and found more information that you may interested in. 1) The manual installation checkpoints list needs an update. It shows 50 points in the documentation, but in the actual list 7 points seems to be gone replaced by other 20. The order is different as well. 2) The hooks start to run in the inst-sys up to: before_switch_scr_finish. Then after_switch_scr_finish and later hooks run in chroot. Therefore the hooks executed up to before_switch_scr_finish runs fine out of the box. A small trick allows to run later hooks as well. I create the file: before_switch_scr_finish_00_fix_chroot.sh which contains the line: cp /var/lib/YaST2/hooks/installation/* /mnt/var/lib/YaST2/hooks/installation in this way the hooks present in inst-sys are present as well in chroot and can be executed. The last hook to be executed in chroot should contain the line: rm -f /var/lib/YaST2/hooks/installation/* May be this trick can be put in the documentation until the issue is fixed properly. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com