Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
init-script to start uml's??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Fri Feb 11, 2005 11:55 am    Post subject: init-script to start uml's?? Reply with quote

I'm experimenting with uml's for some time now. What I still can't do is starting the uml's
in a nice way. I would prefer an init-script like any other service. (/etc/init.d/...)
Does some know where I could find such a script? I found a script here
but that doesn't work right. The uml does start but I can't access it with ssh or screen.
Also the stop fuction doesn't work :?
I also would like to run things as a regular user and not as root.

I hope someone can help me out here, it would really help me a lot! :D
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Sat Feb 12, 2005 2:14 am    Post subject: Reply with quote

-–- deleted -–-

Last edited by TheSmallOne on Thu Dec 20, 2012 3:34 pm; edited 3 times in total
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Mon Feb 14, 2005 8:51 am    Post subject: Reply with quote

Code:

Leviathan home # /etc/init.d/uml start
/sbin/runscript.sh: /var/lib/init.d/uml-11403: line 89: syntax error near unexpected token `}'
/sbin/runscript.sh: /var/lib/init.d/uml-11403: line 89: `}'
 * ERROR:  "/etc/init.d/uml" has syntax errors in it; not executing...

I copy-pasted /etc/init.d/uml 1:1, so no changes there. I edited /etc/conf.d/uml like this:
Code:

# TUN/TAP devices specified here will be persistent
tapdevices="tap12 tappes"

# The user to which a device should belong
device_tap12_user="root"
device_tappes_user="uml"


# Names of the UML machines we want to start
umls="uml1 umlb"

# Required info for the UMLs
uml_uml1_kernel="/home/uml/ftpserver"
uml_uml1_rootfs="/home/uml/RootFS"

uml_umlb_kernel="/home/uml2/webserver"
uml_umlb_rootfs="/home/uml2/RootFS"

# Optional Parameters
uml_uml1_info="UML FTP server"
uml_uml1_user="uml"           # Username under which the UML should run
uml_uml1_mem="128M"           # Amount of memory for the uml
uml_uml1_netconf="eth0=tuntap,tap1"
uml_uml1_disks="ubd1=/home/uml/SwapFS"
uml_uml1_consoles="con0=fd:0,fd:1 con=pts"
#uml_uml1_opts=""

# Optional Parameters
uml_umlb_info="A description for the UML"
uml_umlb_user="uml"           # Username under which the UML should run
uml_umlb_mem="128M"           # Amount of memory for the uml
uml_umlb_netconf="eth0=tuntap,tap2"
uml_umlb_disks="ubd1=/home/uml2/SwapFS"
uml_umlb_consoles="con0=fd:0,fd:1 con=pts"
#uml_umlb_opts=""

Any idea why I get this error? :?
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Mon Feb 14, 2005 9:50 am    Post subject: Reply with quote

-–- deleted -–-

Last edited by TheSmallOne on Thu Dec 20, 2012 3:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Mon Feb 14, 2005 10:29 am    Post subject: Reply with quote

This time it works a lot better :D
Still something goes wrong with the tap-devices. They are not created.
Stopping the uml's gives an error but they are stopped (killed maybe???)
Code:


Leviathan root # /etc/init.d/uml stop
 * Stopping UML UML FTP server (uml1)...                     [ ok ]
* Stopping UML A description for the UML (umlb)...                  [ ok ]
 * Stopping UML  (umlftp)...
 *  UML doesn't exist                           [ !! ]

_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Mon Feb 14, 2005 11:52 am    Post subject: Reply with quote

-–- deleted -–-

Last edited by TheSmallOne on Thu Dec 20, 2012 3:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
mariourk
l33t
l33t


Joined: 11 Jul 2003
Posts: 807
Location: Urk, Netherlands

PostPosted: Mon Feb 14, 2005 1:44 pm    Post subject: Reply with quote

It seems the tapdevice is indeed created but not started:
Code:

Leviathan init.d # cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
  eth0: 1251218    5912    0    0    0     0          0         0   677134    6196    0    0    0     0       0          0
    lo:     176       2    0    0    0     0          0         0      176       2    0    0    0     0       0          0
dummy0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  tap0:       0       0    0    0    0     0          0         0        0       0    0    5    0     0       0          0
  tap1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

I can start tap0 with /etc/init.d/net.tap0, this doesn't happen automaticly.
tap0 has IP 192.168.0.1
Code:

/etc/conf.d/net:
iface_tap0="192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0"

The uml should have 192.168.0.12 but this device is not up.
When I acces an uml with screen, this is what I get:
Code:

uml1 root # /etc/init.d/net.eth0 restart
 * Bringing eth0 up (192.168.0.12)...SIOCSIFFLAGS: Permission denied [ !! ]


Hope this can be fixed.
I have the feeling it will :D
_________________
If there is one thing to learn from history, it's that we usualy don't learn anything from it, at all.
Back to top
View user's profile Send private message
TheSmallOne
Guru
Guru


Joined: 22 Jan 2005
Posts: 467
Location: Germany

PostPosted: Mon Feb 14, 2005 4:30 pm    Post subject: Reply with quote

-–- deleted -–-

Last edited by TheSmallOne on Thu Dec 20, 2012 3:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Tue Feb 15, 2005 9:38 am    Post subject: Reply with quote

From https://forums.gentoo.org/viewtopic-t-234393.html

Here are the comments (date: 02/15/05) to this script in (my bad) english:
I will update this if the orginal comments will changed

-----

$USER is the user who running the uml (i want start it as root)

$NICE can use if you want

$REMOTE_IP is not use in the script, is for information only and should set in the uml

$CONSOLE is set to "null", i want see the boot, i can later access the uml with the following command
Code:
screen `sudo -H -u $USER /usr/bin/uml_mconsole $UMID config con1 | cut -d ":" -f 2`

All $MAC must begin with "fe:fd" to set it up (my experience)

To stop the uml is use the "cad" command from uml_mconsole. To use this you must edit the /etc/inittab inside the uml

replace: ca:12345:ctrlaltdel:/sbin/shutdown -r now
with: ca:12345:ctrlaltdel:/sbin/halt

The script dont work if your /tmp is mountet with noexec. I dont know why.

-----
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum