pctl start, pctl stop, pctl restart, and pctl status
These four commands have the same syntax and take no obligatory arguments:
pctl start <
CT_ID|name
> [--wait]
pctl stop <
CT_ID|name
> [--fast]
pctl restart <
CT_ID|name
>
pctl status <
CT_ID|name
>
The first command is used to start a Container. It will set up all network interfaces inside the Container, initialize the Container quota, if needed, start the
init
process inside the Container, and exit. You can also make the
pctl start
command wait for all the necessary startup processes to complete and the Container to boot into the default runlevel by passing the
--wait
option to this command.
When starting a Container,
pctl
executes a number of helper scripts located in the
/vz/private/<
CT_ID
>/scripts
(the first and last scripts in the table) and
/etc/vz/conf
(all the other scripts in the table) directories, namely (in the order of execution):
mount
|
Optional Container mount script. If it exists, then it is executed immediately after mounting the Container private area. If it exits with a non-zero status, then
pctl
dismounts the Container private area and returns the error.
|
vz-start
|
This script sets up IP traffic accounting for the Container.
|
vz-net_add
|
This script creates the necessary ARP entries and sets up the necessary routing entries for Container IP addresses.
|
ve-alias_add
|
This script configures the network interfaces inside the Container.
|
ve-veconfig
|
This script is called by
pctl
to set a hostname and DNS search domains inside the Container.
|
ve-quota
|
If the second-level (per user/group) quota is turned on, then
pctl
calls this script to form the correct
/etc/mtab
file inside the Container.
|
start
|
Optional Container start script. If it exists, then it is executed in the context of a just started Container.
|
pctl stop
shuts the Container down. If the Container is not down after a two-minute timeout due to an error in an application, for example,
pctl
will forcibly kill all the processes inside the Container. To avoid waiting for two minutes in case of a corrupted Container, you may use the
--fast
option with this command. The normal shutdown sequence of
pctl stop
is described below in the order of execution:
stop
|
Optional Container stop script. If it exists, then it is executed in the context of the Container prior to any other actions. If it exits with non-zero status, then
pctl
does not stop the Container.
|
umount
|
Optional Container unmount script. If it exists, then it is executed after stopping the Container but before dismounting its private area.
|
vz-stop
|
This script deletes routing and IP traffic accounting for the Container.
|
You should use action scripts (
mount
/
umount
and
start
/
stop
) if you would like to carry out some actions upon the Container startup/shutdown. However, there might be situations when you have to modify other scripts documented above. In this case it is strongly suggested that you create a separate script containing all your modifications and add an invocation of this script to shipped scripts. This will facilitate upgrades to future Parallels Server Bare Metal versions.
The
pctl restart <
CT_ID
>
command consecutively performs the stopping and starting of the corresponding Container.
The
pctl status
command shows the current Container state. It outputs the following information: whether the Container private area exists, whether it is mounted and whether the Container is running as in the example below:
# pctl status 101
VEID 101 exist mounted running
|