OpenVZ Forum


Home » Mailing lists » Devel » [WISH] exec early script at start
[WISH] exec early script at start [message #25031] Thu, 13 December 2007 11:13 Go to previous message
Yoann Moulin is currently offline  Yoann Moulin
Messages: 16
Registered: December 2007
Junior Member
Hi all,

I'm working on a xen to openvz migration, and I still have some issue to fix. but some seem to be not possible yet.

actually, on our diskless servers (xen and others), we are using nfsroot. And at start, in the initrd, we are using a script 
that make a connexion on the nfs boot server and remove the old root, create a new one, take the last system image build, and re 
apply configuration with cfengine tools.

I'd like to do the same with openvz, but I didn't see in the source this possibility.

it could be someting like in src/lib/env.c in the vps_start_custom function (in pseudo code) :

         memset(&actions, 0, sizeof(actions));
         if (check_var(res->fs.root, "VE_ROOT is not set"))
                 return VZ_VE_ROOT_NOTSET;
         if (vps_is_run(h, veid)) {
                 logger(-1, 0, "VE is already running");
                 return VZ_VE_RUNNING;
         }
+
+       if (EARLY_SCRIPT) {
+           exec(EARLY_SCRIPT);
+       }
+
         if ((ret = check_ub(&res->ub)))
                 return ret;
         dist_name = get_dist_name(&res->tmpl);
         ret = read_dist_actions(dist_name, DIST_DIR, &actions);
         if (dist_name != NULL)
                 free(dist_name);
         if (ret)
                 return ret;
         logger(0, 0, "Starting VE ...");
         if (vps_is_mounted(res->fs.root)) {
                 /* if VE is mounted -- umount first, to cleanup mount state */
                 vps_umount(h, veid, res->fs.root, skip);
         }

I didn't do C for a while, so I'm not sure I'll be able to do something simple and safe.

I'm available to compile and test this until the openvz server should be production at the end of next week... but I'll take the 
time to do all the test we need before.

If some can help me on this issue.

thanks a lot

Yoann
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC][-mm] Memory controller hierarchy support (v1)
Next Topic: To install OpenVZ in an Oracle installed system
Goto Forum:
  


Current Time: Fri Sep 13 17:15:22 GMT 2024

Total time taken to generate the page: 0.05168 seconds