Opened 10 years ago
Closed 9 years ago
#14733 closed defect (fixed)
Fix startup scripts for Linux From Scratch (LFS) 7.6 or later
Reported by: | hykwok | Owned by: | |
---|---|---|---|
Component: | guest additions | Version: | VirtualBox 5.0.6 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Windows |
Description
After LFS 7.6, the file "/etc/rc.d/init.d/functions" is replaced by the file "/lib/lsb/init-functions" so the startup script files have to be modified otherwise VboxService cannot be started. Modified the files are attached for your reference.
Attachments (22)
Change History (38)
by , 10 years ago
by , 10 years ago
Attachment: | vboxadd.diff added |
---|
by , 10 years ago
Attachment: | vboxadd-service added |
---|
by , 10 years ago
Attachment: | vboxadd-service.diff added |
---|
by , 10 years ago
Attachment: | vboxadd-x11 added |
---|
by , 10 years ago
Attachment: | vboxadd-x11.diff added |
---|
comment:1 by , 10 years ago
comment:2 by , 9 years ago
Sorry if this solution is slightly more bare-bones than what you have (our development code has the same thing, but for all distributions), but could you give the following a try? Not yet tested myself for lack of time, if you do some testing - host and guest - you will speed things up.
by , 9 years ago
Attachment: | no-lfs.patch added |
---|
Remove special Linux from Scratch handling in init scripts, which are now an endangered species in any case
comment:3 by , 9 years ago
I tested your patch in my system (LFS 7.8). However, I could not shutdown the system normally. After some tests, I found a solution: add a delay in the "Killproc" of the "vboxadd-service" file.
comment:5 by , 9 years ago
The new file, vboxadd-service.sh, cannot kill the service. (I.e. the system cannot shutdown normally) Please note that I have checked the PID file name so I am sure I have used the correct script file to start the service: Before patch: /var/run/vboxadd-service.pid, After patch: /var/run/vboxadd-service, New sh file: /var/run/vboxadd-service.sh
comment:7 by , 9 years ago
I have tried your new file (version 2) and it can shutdown the serive. However, after I use it to replace the existing file, /etc/rc.d/init.d/vboxadd-service, and restart the system, the system cannot shutdown normally. I have rebooted the system again (cold boot) but the result is same.
comment:8 by , 9 years ago
The latest script still has problem. Please check the difference between the return code.
comment:9 by , 9 years ago
That's what I get for doing blind testing I suppose (though that said, you could actually debug the script rather than just posting screen-shots). Anyway, here is another to try.
comment:10 by , 9 years ago
Not work. The new script still returns 1 after exit. After code checking, the logic in the "killproc" function has problem:
According to man page of "pkill" command, the "EXIT STATUS" is:
0 - One or more processes matched the criteria.
1 - No processes matched.
2 - Syntax error in the command line.
3 - Fatal error: out of memory etc.
So, in your script, the "pkill" command will be executed twice: the fisrt "pkill" command returns 0 and the second one returns 1 because the process is already killed.
My modification of this part is submitted: the "killproce" function returns immediately when the "pkill" command returns 0.
comment:11 by , 9 years ago
Ahem, yes, I realised that, I just uploaded the wrong script as vboxadd-service.5.sh - it was the same as .4, not my fixed version. Here is what I meant to upload as version 5...
comment:12 by , 9 years ago
And thanks for investigating. I should clearly have asked you to do that earlier.
comment:13 by , 9 years ago
I have tested the new script (version 6) and it works.
And one more thing: I wish you can fix the build script for the guest addition.
That's because I have to create the symbolic link for the "/etc/rc.d/init.d/functions" before I execute the Linux guest addition installation file otherwise I cannot build the modules and other files for my LFS system.
comment:15 by , 9 years ago
I have tested the additions 5.0.x revision 103994 and it works. Thanks for the support.
comment:16 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fix is part of VBox 5.0.10. Thanks for the feedback.
The TOC of the latest LFS book: http://www.linuxfromscratch.org/lfs/view/stable/