Previous page

Next page

Locate page in Contents

Print this page

pctl runscript

The pctl runscript command is used to run shell scripts in Containers. For example, you can add this command to scripts you use to perform customization or configuration tasks in the Container context. The syntax of pctl runscript is as follows:

pctl runscript < CT_ID > < script_path >

The command requires the following input parameters:

  • The ID of the Container where you want to run the script.
  • The full path to the script on the server.

If you execute the command for a running Container, it just jumps into the Container and runs the specified script there. If, however, you run the command for a stopped Container, the sequence of operations is slightly different: Once vzctl enters the Container, it mounts the root ( / ) filesystem, and then executes the script. Notice that in this case only the following instances are running in the Container:

  • a process for the vzctl session
  • the script
  • processes initiated by the script