User`s guide

Managing Services and Processes 133
2. In the current version of Parallels Server Bare Metal, you cannot use the vzsetxinetd
utility for managing services in virtual machines.
Determining Container Identifier by Process ID
Each process is identified by a unique PID (process identifier), which is the entry of that process
in the kernel's process table. For example, when you start Apache, it is assigned a process ID.
This PID is then used to monitor and control this program. The PID is always a positive integer.
In Parallels Server Bare Metal, you can use the vzpid (retrieve process ID) utility to print the
Container ID the process with the given id belongs to. Multiple process IDs can be specified as
arguments. In this case the utility will print the Container number for each of the processes.
The typical output of the vzpid utility is shown below:
# vzpid 12
Pid VEID Name
12 101 init
In our example the process with the identifier 12 has the name 'init' and is running in the
Container with ID 101.
Note: You can also display the Container ID where the corresponding process is running by
using the vzps utility.
Starting, Stopping, and Restarting Services
You can manage (i.e. start, stop, and restart) services by using the command line. For example,
you wish to start the httpd service. To do this, execute the following command:
[root@ct222 /]# service httpd start
where service is the standard Linux command, httpd denotes the name of the
corresponding service, and start is the command that will launch this service. In order to
check that the httpd service was successfully launched, you can either type the following
Linux command:
[root@ct222 /]# service httpd status
or use the vzps utility when working on your server or the ps utility when working inside your
Containers and passing them the x argument. The output will tell you if the httpd service is
running in your system or not.