How to run a script on HN after VPS start [message #8380] |
Sat, 18 November 2006 06:21 |
duswil
Messages: 77 Registered: January 2006
|
Member |
|
|
I am needing to run some commands automatically on the HN after a specific VPS has started. Using 123.mount doesn't work because it is run too early. 123.start doesn't work because it is run inside the VPS instead of on the HN. Is there a way to do something similar to 123.start, but have it run on the HN? It needs to run after all the network devices for the VPS have been initialized.
|
|
|
|
|
|
Re: How to run a script on HN after VPS start [message #8398 is a reply to message #8380] |
Sat, 18 November 2006 20:40 |
rickb
Messages: 368 Registered: October 2006
|
Senior Member |
|
|
I have wanted to do this as well. Unfortunately I couldn't find a clean way to run a command in the HN context after a VE starts. What I did was use cron, running a script each minute to accomplish whatever commands you need run. ie, after you run whatever command you are referring to, something probably changes. "check" to see if that change was made with the cron script, if it wasn't, run the command. In my case, it was adding some --devnodes to the started VPS, but I didn't want to maintain a mount-script file for each VE. Hope this helps.
-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions
UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Updated on: Sat, 18 November 2006 20:45] Report message to a moderator
|
|
|
|
|
|