Pass an option to LILO in order to have a script/command executed at/after boot ?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Pass an option to LILO in order to have a script/command executed at/after boot ?
Hi !
I have one distro installed, LILO as the boot loader, and i wonder if it's possible to duplicate the lilo entries with an option which executes some script or command during, or after the boot.
Actually, i installed a Slackware + autolaunching virtual machine, but i have two VM, so i need to autolaunch one of them. May i choose it from the very beginning ?
Not sure about other members, but I can't really understand what exactly the situation is here, nor quite what you're asking.
I see you have lots of posts, so I am guessing you're not *new* to Slackware and may already know what I'm going to post here:
I will try to answer at least *one* question for you. To execute a command or script after boot (kinda during very late boot really) you could use the rc.local script in /etc/rc.d.
Again, sorry if you already know this, but again, I really don't understand the question. Could you re-phrase it to better explain the relationships between the OSs and the VM's ?
But you can tell lilo which runlevel to boot at. So you could have three similar entries, but tell the first one to boot at runlevel 3 (console usually), the other at runlevel 5 (usually X), and the other at runlevel 4, for example, and use the 4th runlevel to launch the vm. It's a matter of adding the service or application to the given runlevel, that varies depending on your init system, and it can be more or less complicated depending on the app you want to run. You will need to find a way to ensure that everything that's needed to run the vm is already up, like X for example if needed.
I just checked on the lilo.conf man pages to see if there might be somekind of optins but nope.
I dunno if I would go with the runlevel to chosse between the two vm's. I'd rather would go with rc.local. Idea. Copy the kernel twice and append -vm1 and -vm2 to the file name. Make two lilo entries and check in rc.local with uname -a which one is loaded and start vm according to it.
There might be a chance that you could use init do do something like this.....
I just checked on the lilo.conf man pages to see if there might be somekind of optins but nope.
I dunno if I would go with the runlevel to chosse between the two vm's. I'd rather would go with rc.local. Idea. Copy the kernel twice and append -vm1 and -vm2 to the file name. Make two lilo entries and check in rc.local with uname -a which one is loaded and start vm according to it.
Well, you can do whatever you want, but it's truly the same thing, and you wouldn't need to copy or symlink your kernel with a different name...
All you need to boot from one or another runlevel is to add the runlevel number to the kernel command line, a simple number. Then just add whatever command you use to run the vm to the right runlevel rc file instead of rc.local.
Quote:
There might be a chance that you could use init do do something like this.....
rc files are all part of the init system, including rc.local... You can use whatever system you feel is better, however I have the impression that you should first research a bit about the init system of your distribution so you can learn which option if the best for you.
rc files are all part of the init system, including rc.local...
I meant the init process itself.
You can use the -z option with an argument with init. Taken from the man pages the argument is ignored but ps will show it. So you can skim through ps or /proc/1/cmdline to make the decision.
But you can tell lilo which runlevel to boot at. So you could have three similar entries, but tell the first one to boot at runlevel 3 (console usually), the other at runlevel 5 (usually X), and the other at runlevel 4, for example, and use the 4th runlevel to launch the vm. It's a matter of adding the service or application to the given runlevel, that varies depending on your init system, and it can be more or less complicated depending on the app you want to run. You will need to find a way to ensure that everything that's needed to run the vm is already up, like X for example if needed.
I just checked on the lilo.conf man pages to see if there might be somekind of optins but nope.
I dunno if I would go with the runlevel to chosse between the two vm's. I'd rather would go with rc.local. Idea. Copy the kernel twice and append -vm1 and -vm2 to the file name. Make two lilo entries and check in rc.local with uname -a which one is loaded and start vm according to it.
There might be a chance that you could use init do do something like this.....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.