OpenVZ Forum


Home » General » Support » OpenVZ template needs command after build?
OpenVZ template needs command after build? [message #51258] Wed, 26 March 2014 10:32 Go to next message
postcd is currently offline  postcd
Messages: 73
Registered: April 2013
Member
Hello,

i have an OpenVZ default contrib template and on it installed "vncserver" application.

Issue is that "vncserver" when launched it has an pid file:

root@kcgbqjnv:~/.vnc# ls -la
total 28
drwx------  2 root root 4096 Mar 26 10:04 .
drwx------ 16 root root 4096 Mar 26 10:04 ..
-rw-------  1 root root    8 Mar 26 10:17 passwd
-rw-r--r--  1 root root 1115 Apr  8  2013 server:1.log
-rwxr-xr-x  1 root root  266 Apr  8  2013 xstartup
-rw-r--r--  1 root root  463 Mar 26 10:04 [b]zzz:1.log[/b]
-rw-r--r--  1 root root    5 Mar 26 10:04 [b]zzz:1.pid[/b]


zzz is hostname which is automatically used during vncserver startup.

So as you can see, i need to delete these *zzz* files and start vnc server AUTOMATICALLY AFTER OPENVZ TEMPLATE IS BUILT TO A NEW VM.

Please how can i achieve this task?

thank you

-------
my idea is to create cron script which will do taks and delete itself.. so when template is applied to vm, it will do the job and maybe delete itself?

[Updated on: Wed, 26 March 2014 12:35]

Report message to a moderator

Re: OpenVZ template needs command after build? [message #51262 is a reply to message #51258] Thu, 27 March 2014 00:35 Go to previous message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
If I understand you correctly, you need to permanently change an existing template so that old .pid files aren't there and the vncserver service is set to start at boot.

What I would do is simply:
- create a temporary VM with this template, start it
- vzctl enter VMID
- delete the old .pid files, set the vncserver service to start at boot (chkconfig ...)
- exit and stop the VM.

Archive the /vz/private/<VMID> as a new template (give it your name if you wish, etc.) and use it from now on as your starting template. You can now of course delete the temporary VM if you wish.

A similar procedure is described here:
http://wiki.openvz.org/Fedora_template_update
Previous Topic: OpenVZ kernel for Squeeze
Next Topic: How to rebuild VM from other OSTEMPLATE?
Goto Forum:
  


Current Time: Wed Sep 04 02:23:30 GMT 2024

Total time taken to generate the page: 0.05158 seconds