Overview
Note:
This script is for cPanel users. It only configures services for the user that runs the script.
The cpuser_service_manager
script adds and removes user-managed and monitored services for your cPanel account. User-managed services are programs that you want your server to run all the time, such as a web application that runs in either tomcat, PSGI, rails, or WSGI, among others. Use this script to manage services run as the user, rather than the root
user.
This script also configures the Ubic subsystem on your account, which allows you to easily manage your services, and adds a watchdog cron job to monitor your services.
Important:
You must possess terminal access to use this script and the Ubic subsystem. The system administrator controls this access in WHM's Manage Shell Access (WHM >> Home >> Account Functions >> Manage Shell Access) interface.
The /usr/local/cpanel/scripts/cpuser_service_manager
script
To use this script, run the following command on the command line:
/usr/local/cpanel/scripts/cpuser_service_manager [argument] [options]
Arguments
Note:
When you run this script, it will also configure the Ubic subsystem and add a watchdog cronjob if necessary. A watchdog cronjob monitors the status of your services.
The /usr/local/cpanel/scripts/cpuser_service_manager
script accepts the following arguments, where service_name
represents the name of a service and path
represents a file path:
Argument | Description | Example |
---|---|---|
| Set up a user managed and monitored service. Notes:
| /usr/local/cpanel/scripts/cpuser_service_manager add my_psgi_app --init-script=/path/to/init.file /usr/local/cpanel/scripts/cpuser_service_manager add my_psgi_app --ubic-service=/path/to/ubic.file |
info | Display information about how the script works and what it does. | /usr/local/cpanel/scripts/cpuser_service_manager info |
list | Display a list of the user managed and monitored services. | /usr/local/cpanel/scripts/cpuser_service_manager list |
remove service_name | Remove a service. | /usr/local/cpanel/scripts/cpuser_service_manager remove my_psgi_app
|
hint [argument] | Display the abbreviated help information. Note: The | /usr/local/cpanel/scripts/cpuser_service_manager hint add |
help [argument] | Display the script's help information. The | /usr/local/cpanel/scripts/cpuser_service_manager help add |
The Ubic subsystem
The /scripts/cpuser_service_manager
script configures the Ubic subsystem, if necessary, when you add a service to your cPanel account. This subsystem enables easy management of your system's services on the command line. Use this subsystem to stop, start, restart, and see the status of your account's services.
The Ubic subsystem configuration adds the following to your account:
- The
~/ubic
directory The
~/.ubic.cfg
fileImportant:
Do not edit the the
~/.ubic.cfg
file or it will not function correctly.- A cronjob that includes a Ubic watchdog process to monitor the status of your service.
To use the Ubic subsystem, run the following command on the command line:
ubic [argument] [service_name]
Note:
If ubic does not exist in your PATH, you must add it to your configuration. For example, you might add the following line to your .bashrc
file:
export PATH=$(dirname $(readlink /usr/local/cpanel/3rdparty/bin/perl)):$PATH
Important:
Jailshell users cannot see the status of their previously started Tomcat service. The default jailshell permissions only allow users to view their current session's processes. If they attempt to restart an already active service with Ubic, the system will launch a duplicate process.
You can use the following arguments to manage your services with Ubic, where service_name
represents the name of the service that you wish to modify:
Argument | Description | Example |
---|---|---|
status service_name | Display the status of a service. | ubic status my_psgi_app
|
start service_name | Start a service. | ubic start my_psgi_app
|
stop service_name | Stop a service. | ubic stop my_psgi_app
|
restart service_name | Restart a service. | ubic restart my_psgi_app
|
You can view other possible arguments with the man ubic
command.
Additional documentation