OpenVZ Forum


Home » General » Support » How to start script when the VE starts
How to start script when the VE starts [message #40667] Fri, 17 September 2010 10:12 Go to next message
open vau zett is currently offline  open vau zett
Messages: 2
Registered: September 2010
Location: Germany
Junior Member
Hello,

Has anybody an indea of how to start a shell-script when a VE starts?

Each single Container needs to be given a route to get its network working. I'd like to do this when a container is being started.
I'd like to have a smart solution, i. e. the script should only be executed when its container is being started (onboot=yes).

This is important, because when the main server is rebooted unattendedly, the route should only be applied to containers that have been automatically started.

Any ideas? Thanks in advance!


Yours,
open vau zett
Re: How to start script when the VE starts [message #40669 is a reply to message #40667] Fri, 17 September 2010 11:14 Go to previous messageGo to next message
Sov1et is currently offline  Sov1et
Messages: 9
Registered: September 2010
Location: Ukraine Donetsk
Junior Member

place commands in /etc/rc.local file
Re: How to start script when the VE starts [message #40671 is a reply to message #40667] Fri, 17 September 2010 11:57 Go to previous messageGo to next message
open vau zett is currently offline  open vau zett
Messages: 2
Registered: September 2010
Location: Germany
Junior Member
Hello,

I'm using Suse Linux, and it seems as if there is no /etc/rc.local file.
However, there is a /etc/rc.d file, but this is only a link to /etc/init.d, where the normal startup scripts are located.

Anyway, even if I place a script there, how should I give a container instructions? I had to check, wether a container is running; isn't this much effort?
I think it would be better, if I could let openVZ do start my script per container...
Re: How to start script when the VE starts [message #40672 is a reply to message #40667] Fri, 17 September 2010 12:28 Go to previous message
Sov1et is currently offline  Sov1et
Messages: 9
Registered: September 2010
Location: Ukraine Donetsk
Junior Member

I don't now how let openVZ start script per container.
Any way for Suse use /etc/init.d/boot.local file to start command every boot.
You can write sh script to start VE and run coommand: vzctl $ID exec $COMMAND
Previous Topic: Ubuntu 10.04 container hangs after vzrestore
Next Topic: Need help with installing OpenVZ on Ubuntu 10.04
Goto Forum:
  


Current Time: Thu Jul 18 05:26:05 GMT 2024

Total time taken to generate the page: 0.02624 seconds