Uninstalling the Trino Protector

The single-node uninstallation script generated by the configurator script is used to uninstall the Trino Protector. Copy and execute the single-node uninstallation script to all the nodes in the Trino cluster.

Execute the following steps on every co-ordinator and worker node of the Trino Cluster.

  1. Log in to the node, where you want to execute the uninstallation script.

  2. Copy/Download the single-node uninstallation script previously generated by the configurator script to any directory.

  3. Navigate to the directory where the single-node uninstallation script is located.

  4. To view the syntax and the usage of the uninstallation script, run the following command.

    ./TrinoProtector_UninstallationScript_10.0.0+x.sh --help
    
  5. Press ENTER.

    The command displays the syntax with the mandatory and optional arguments. The mandatory and optional arguments are explained in the following tables.
    Table 1. Mandatory Arguments for the Uninstallation Script

    ArgumentDescription
    --uninstall-rpagent-and-logforwarder=<yes|no>Instructs the script whether to remove the RPAgent and the Log Forwarder from the current node in the Trino cluster. The acceptable values are:
    • yes - remove the RPAgent and the Log Forwarder from the current node in the Trino cluster.
    • no - skip removing the RPAgent and the Log Forwarder if they were already not installed by the corresponding Trino Protector installation script.
    --trino-plugin-dir=</path/to/plugin/>Specifies the absolute path to the Trino plugin directory.
    Note
    You can set a custom plugin path using the plugin.dir property in the node.properties Trino configuration file. Ensure that the current sudoer user has permissions to read and write into this directory.
    --trino-service-user=<user>Specifies the name of the user running the Trino server. You can use this argument to set the ownership of the peptrino plugin directory and also to restart the Trino server if you specify the --restart-trino-server-via=launcher argument.
    Note
    • Ensure that the current sudoer user is able to run commands as the Trino service user using the sudo -u command.
    • Ensure that the Trino service user is able to read the files from the <installation_directory> path.
    --delete-protegrity-user=<yes|no>Specifies whether to remove or retain the Protegrity service user and group, that were created during the installation process, from the current node in the Trino cluster. Set the value for this argument to no when you set the value for the --uninstall-rpagent-and-logforwarder argument to no. The accepted values are:
    • yes - instructs the script to remove the Protegrity service user and group from the current node in the cluster.
    • no - instructs the script to skip the removal of the Protegrity service user and the group.

    Table 2. Optional Arguments for the Uninstallation Script

    ArgumentDescription
    –sudo-disabled
    • Use this flag if sudoers is disabled on the cluster.
    • If you use this flag, the script will skip the use of the sudo command. The current user will be used to remove and stop the Protegrity services. Therefore, the user must have permissions to remove the Protegrity files under the <installation_directory> and the Trino plugin directory and to modify the config.properties file.
    • The input values for the –trino-service-user and the –protegrity-user arguments must be same as the current user.
    • You will be unable to use the –restart-trino-server-via argument
    • When you exclude this argument, a user with sudoers privilege is required to execute the script. It is recommended to use a NOPASSWD sudoers user. Else, the script will prompt for a password.
    –protegrity-user=<user>If you specify this argument, then the script will set the Protegrity service user that was provided during installation to set the owner of the installed directories and files, and to start the Protegrity services. Ensure that the Protegrity service user has read permissions on the parent directories of the <installation_directory>.
    Note
    • If you set the value of the –uninstall-rpagent-and-logforwarder argument to yes, then the uninstallation script will use this user account to stop the RPAgent and the Log Forwarder services.
    • Ensure that the current user with sudoer privileges is able to execute the commands as the Protegrity service user (using the sudo -u command) to stop the Protegrity services.
    • If you set the value of the –sudo-disabled argument to yes, then the script will use this user account to stop the Protegrity services.
    If you fail to specify this argument, then the installation script will set the current user as the Protegrity service user.
    –protegrity-group=<group>If you specify this argument, then the script will set the Protegrity service group that was given during installation to set the group of the installed directories and files, and to start the Protegrity services.
    If you fail to specify this argument, then the installation script will set the current user’s primary group as the Protegrity service group.
    –restart-trino-server-via=<systemd|init|launcher>If you specify this argument, then the script will restart the running Trino server after removing the peptrino plugin. The script will not restart the Trino server if the server is in the stopped state. If you want to use this argument, ensure that you enable sudo to restart the Trino server. The acceptable values are:
    • systemd - instructs the script to use the systemctl command to check the status and restart the Trino server. This argument requires the –trino-systemd-service-name argument to be specified.
    • init - instructs the script to use the service command to check the status and restart the Trino server. This argument also requires you to specify the –trino-init-service-name argument.
    • launcher - instructs the script to use the Trino launcher script to check the status and restart Trino server. This argument requires the –trino-launcher-path and the optional –trino-launcher-args arguments.
    If you exclude this argument, then the script will not attempt to restart the Trino server. You must manually restart the Trino server after the script execution completes.
    –trino-systemd-service-name=<service name>Specifies the name of the systemd service associated with the Trino server. You must specify this argument when you use the –restart-trino-server-via=systemd argument.
    –trino-init-service-name=<init service name>Specifies the name of the Sys V init service associated with the Trino server. You must pass this argument when you specify the –restart-trino-server-via=init argument.
    –trino-launcher-path=</path/to/bin/launcher>Specifies the absolute path to the Trino server launcher script. For example, /usr/lib/trino/bin/launcher. You must specify this argument when you use the –restart-trino-server-via=launcher argument.
    –trino-launcher-args=“arg1 [arg2…]"Specifies the valid command line arguments to the Trino launcher script. You can use this argument with the –trino-launcher-path argument. If you specify this argument, then the arguments listed between the double-quotes will be passed to the Trino launcher script for the status and the restart commands. If you fail to specify this argument, then no argument will be passed to the Trino launcher script for the status and the restart commands.

    1. Depending on the requirements, run the uninstallation script with the required arguments.

      For example, on a Starburst Trino cluster installed via RPM, one combination of the arguments to the single-node uninstallation script is listed below.

      ./TrinoProtector_UninstallationScript_10.0.0+x.sh \
      >   --uninstall-rpagent-and-logforwarder=yes \
      >   --trino-plugin-dir=/usr/lib/starburst/plugin \
      >   --trino-service-user=starburst \
      >   --protegrity-user=ptyitusr \
      >   --protegrity-group=ptyitusr \
      >   --delete-protegrity-user=yes
      

      Note: If you want the Trino Server to automatically restart after removing the components, then specify the value for the --restart-trino-server-via argument for the uninstallation script. Otherwise, you will have to manually restart the Trino Server after the uninstallation is complete.

    2. Press ENTER. The script removes the components as specified in the arguments.

      ./TrinoProtector_UninstallationScript_10.0.0+6.sh \
      >   --uninstall-rpagent-and-logforwarder=yes \
      >   --trino-plugin-dir=/usr/lib/starburst/plugin \
      >   --trino-service-user=starburst \
      >   --protegrity-user=ptyitusr \
      >   --protegrity-group=ptyitusr \
      >   --delete-protegrity-user=yes
      
      Protegrity Trino Protector Uninstallation Script started...
      
      Validating sudo permissions for root
      ************************************************************************************
                      Welcome to the Trino Protector Uninstall Wizard.
      ************************************************************************************
      This will uninstall the Trino Protector from your system.
      
      Stopping RPAgent on current node...
      
      Stopping Logforwarder on current node...
      
      RPAgent uninstallation started
      ************************************************************************************
                          Welcome to the RPAgent Setup Wizard.
      ************************************************************************************
      
      Uninstalled RPAgent on current node...
      
      Logforwarder uninstallation started
      ************************************************************************************
                          Welcome to the LogForwarder Setup Wizard.
      ************************************************************************************
      
      Uninstalling LogForwarder ....
      
      LogForwarder uninstalled on current node at location /opt/protegrity/logforwarder/
      
      PepTrino Plugin Jars uninstallation started
      ************************************************************************************
                          Welcome to the PepTrino Setup Wizard.
      ************************************************************************************
      
      Uninstalling PepTrino ....
      
      PepTrino uninstalled on current node at location /opt/protegrity/peptrino/
      
      JcoreLite uninstallation started
      ************************************************************************************
                              Welcome to the JcoreLite Setup Wizard.
      ************************************************************************************
      
      Uninstalling JcoreLite ....
      
      JcoreLite for Trino Protector uninstalled on current node at location /opt/protegrity/peptrino/lib/
      
      Setting ownership of /opt/protegrity/logs and /opt/protegrity/peptrino recursively to root:root.
      
      Setting ownership of /opt/protegrity to root:root.
      
      Removing Protegrity service user 'ptyitusr' and group 'ptyitusr' from current node.
      
      User 'ptyitusr' deleted
      
      Group 'ptyitusr' deleted
      
      Trino Protector plugin jars and JcoreLite libraries uninstalled from /opt/protegrity/peptrino/ directory
      
      Finished executing TrinoProtectorUninstall468_Linux-ALL_10.0.0+x.sh script. Check the logs at /opt/protegrity/logs/
      
      Started uninstallation of PepTrino from plugin dir in foreground...
      
      Checking if Trino Plugin Dir is present on node.
      Trino Plugin Directory /usr/lib/starburst/plugin found.
      
      Removing peptrino plugin directory from /usr/lib/starburst/plugin
      
      Trino Protector Plugin successfully removed from /usr/lib/starburst/plugin
      
      Checking if Trino service user exists.
      
      Checking if systemctl is on PATH.
      
      systemctl found on PATH.
      
      Checking if 'starburst' is a valid systemd unit.
      
      'starburst' is a valid systemd unit.
      
      Checking if Trino Server is started and running via systemctl
      
      Trino server is running
      
      Restarting Trino Server...
      
      Trino Server successfully restarted via systemctl.
      
      Trino Protector UDFs were unregistered on Trino Server restart. Verify via trino CLI (show functions;) or by checking Trino's server.log
      
      Successfully completed all steps of Uninstallation Script
      

    Last modified : December 18, 2025