LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-08-2014, 02:59 PM   #16
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860

Rep: Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228

Yeah, I know. The OP's use case seems legitimate, however; at least I can see why he would want to do it that way.
 
Old 10-09-2014, 04:08 AM   #17
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531

Rep: Reputation: 272Reputation: 272Reputation: 272
Looks like the OP is using snapshots of a static "gold image" to generate the new VMs' virtual hard drive.
One way to get the desired result is to make 2 snapshots (one with init3, one with init4) and use a snapshot of those as the new VM virtual hard drive...
This way, the script used to generate the VM would decide which init will be used, not a script inside the VM.
 
Old 10-09-2014, 06:50 AM   #18
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860

Rep: Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228
Then you have to remember to change two images instead of merely one. (Your way is how I'd probably do it, to tell the truth, but I can see why someone else would want to maintain only one image.)

Of course the additional advantage of your way is that adding a new special MAC address doesn't require re-creating the VM image to include that address for the internal test. I guess that the path of least resistance depends upon which changes the fastest: the list of special MAC addresses or the contents of the VM image (outside of the special MAC address list).
 
Old 10-09-2014, 07:53 AM   #19
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531

Rep: Reputation: 272Reputation: 272Reputation: 272
Quote:
Originally Posted by Richard Cranium View Post
Then you have to remember to change two images instead of merely one. (Your way is how I'd probably do it, to tell the truth, but I can see why someone else would want to maintain only one image.)
You don't have to change any images.

This is what he uses:
read_only_gold_image --> snapshot

This is what I would use:
read_only_gold_image --┬-> read_only_snapshot_init3 --> snapshot
.................................└-> read_only_snapshot_init4 --> snapshot

Last edited by Slax-Dude; 10-09-2014 at 07:58 AM. Reason: stupid ascii
 
Old 10-09-2014, 08:05 AM   #20
nolretou
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
That's two images to manage.
 
Old 10-09-2014, 08:33 AM   #21
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531

Rep: Reputation: 272Reputation: 272Reputation: 272
They are read_only static snapshots, that take a few Kb of space... there is not much to "manage".

You already do this with your "read-only Qemu image", yes?
Quote:
Originally Posted by nolretou View Post
I have a read-only Qemu image with a test script launched by rc.local .
I create many relative images with different MAC addresses.
 
Old 10-09-2014, 08:40 AM   #22
nolretou
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
They are not modified.
 
Old 10-09-2014, 09:33 AM   #23
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531

Rep: Reputation: 272Reputation: 272Reputation: 272
No, they are not.
Like I said, they are read-only
That is why I don't understand what you mean by "That's two images to manage".
Manage what?

Since the dynamic changing from init3 to init4 seems complicated, I thought of an alternative solution.
Please disregard if it does not help in your use case.
 
Old 10-09-2014, 09:35 AM   #24
nolretou
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
According to your setup, both images have a different setup. One is rc.3, other is rc.4.
 
Old 10-09-2014, 09:51 AM   #25
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 531

Rep: Reputation: 272Reputation: 272Reputation: 272
Quote:
Originally Posted by nolretou View Post
According to your setup, both images have a different setup. One is rc.3, other is rc.4.
Yes, but only have to change the snapshots once, on creation, then use them the same way you use your current image (read-only) on every new VM you make.

When you make a new VM you are using snapshots, right?

Last edited by Slax-Dude; 10-09-2014 at 10:28 AM.
 
Old 10-10-2014, 04:18 AM   #26
nolretou
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
Bad advice on my part. You shouldn't exit rc.4, but stay in it; the display managers that are launched aren't running as daemons.

So instead of exiting, run in a while loop with a sleep like so...
Code:
while /bin/true; do sleep 10; done
Tested it, it works.
I mark the thread as solved although I'm open for any other solution.
 
Old 10-10-2014, 07:28 PM   #27
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860

Rep: Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228Reputation: 2228
Aha.

qemu appears to accept an "-append" option (from "man qemu" and scrolling down a hell of a lot)...

Code:
       -append cmdline
           Use cmdline as kernel command line
...so you can have exactly one VM image that has its default initlevel at 3. Move your "which ones do I want to use runlevel 4" logic out of the VM and into whatever is launching the VMs. Just add "-append 4" to the qemu command line for those special VMs and they should goto runlevel 4 when they start.

(Any runlevel that you provide on the kernel command line overrides /etc/inittab)

Last edited by Richard Cranium; 10-10-2014 at 07:29 PM. Reason: It might be nice to know where I found that info.
 
2 members found this post helpful.
Old 10-13-2014, 03:05 AM   #28
nolretou
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 98

Original Poster
Rep: Reputation: Disabled
The -append is only allowed with the -kernel option, which I don't use.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] IPv6 "link-local" fe80:: vs "unique local address (ULA)" fc00:: + fd00:: psycroptic Linux - Networking 4 08-07-2014 12:51 AM
Failed to execute child process "/usr/local/eclipse/eclipse" (No such file or directo raju k Linux - Newbie 1 06-07-2013 02:47 AM
"failed to execute child process" "Input/output error" fl.bratu Fedora 4 12-15-2008 04:03 AM
Execute "telinit q" while programs are running ? Vilius AIX 1 11-26-2008 09:54 AM
SuSE Linux will not boot. FAILSAFE, then "telinit 5" works mindthief Linux - Software 0 12-08-2006 07:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration