Uninstalling UNIX Platform Agents
The steps for removing a Platform Agents from UNIX are as follows.
- Remove the Daemon.
- Remove sudo settings (if necessary).
- Remove the program binaries and output files.
The specifics of each step depend on your UNIX system, which will be using SysVinit, systemd, or Solaris SMF.
1. Remove the Daemon
SysVinit
If you chose to start the Platform Agent automatically at system startup, the installer will create a startup script named scheduler
in the ${InstallDir}/etc
folder, and a symlink to it from your system rc
folder (for example /etc/init.d
).
To remove the daemon:
- In your startup script directory, run the following command to find files linking to
scheduler
:ls -lR | grep redwood
- Remove all links listed.
- Remove the
scheduler
script.
Systemd
The installer will create systemd services, a wrapper service, and services for each instance.
To remove the daemon:
- For each instance you wish to remove, in
/etc/systemd/system/scheduler.service.wants/
, identify the service namescheduler@<service_name>.service
, and run this command:systemctl stop scheduler@<service_name>
- To disable the corresponding
scheduler@<service_name>
services, run this command:systemctl disable scheduler@<service_name>
. This will remove the/etc/systemd/system/scheduler.service.wants/scheduler@<service_name>.service
file. - To reload systemd and reset failed services, run this command:
systemctl daemon-reload
systemctl reset-failed
- If you have removed all instances and wish to remove the
scheduler
service, run this command:systemctl disable scheduler
- If you disabled the
scheduler
service, reload systemd and reset failed services by running this command:systemctl daemon-reload
systemctl reset-failed
SMF
On Solaris, the installer will create a SMF service for your Platform Agents.
To remove the daemon:
- To check for any dependencies, run this command:
svcs -D application/redwood/scheduler
- If none are found, disable the service, like so:
svcadm disable application/redwood/scheduler
- To remove the service for a Platform Agent instance:
- To delete the SMF service for instance
default
, run this command:svccfg delete svc:/application/redwood/scheduler:default
- To delete the SMF service for all Platform Agent instances, run this command:
svccfg delete svc:/application/redwood/scheduler
- To delete the SMF service for instance
- If you deleted all instances of the service, remove the corresponding SMF XML file with this command:
rm /lib/svc/manifest/application/redwood/scheduler.xml
2. Remove sudo Settings
This step is not necessary if you used setuid
for user switching, or did not use the sudo security option.
If you choose the sudo security option, the installer checks to see if your system has a /etc/sudoers.d
directory. If it does, the installer creates a redwood-platform-agent.conf
file in the directory with the sudo
configuration, otherwise. If not, the installer appends the sudo
configuration to your /etc/sudoers
file.
To delete the sudo
settings:
- If the
/etc/sudoers.d
directory exists, delete the/etc/sudoers.d/redwood-platform-agent.conf
file. - If you only have a
/etc/sudoers
file, usevisudo
to remove the lines listed below from/etc/sudoers
.
# Redwood sudoers configuration
# The list of hosts on which these rules apply
Host_Alias RW_JOB_HOST = ALL
# The list of other users that Redwood can run commands as
Runas_Alias RW_JOB_RUNAS = ALL, !root, mail, bin
Runas_Alias RW_CHOWN_RUNAS = root
# The list of commands that Redwood Platform Agent can run
Cmnd_Alias RW_JOB_PROCESSOR = <installdir>/<instance>/*/bin/job-processor
Cmnd_Alias RW_CHOWN = /bin/chown -R -h * <installdir>/<instance>/var*
# User Host runAs Tags Command
<user name> RW_JOB_HOST = (RW_JOB_RUNAS) NOPASSWD: EXEC: RW_JOB_PROCESSOR
<user name> RW_JOB_HOST = (RW_CHOWN_RUNAS) NOPASSWD: RW_CHOWN
3. Remove Binaries and Data Files
Note: You must be root
to successfully remove all files.
The default installation path for Platform Agents is /opt/redwood/agent
. If you are removing all instances of Platform Agents, you can safely delete the <version>
, etc
, and latest
directories. The var
directory may contain process output data, so make sure you have backed up what you need before you delete it.
Removing the Software
There is no automated process for removing the software. However, the following procedure will remove everything associated with the software.
- Locate the installation directory of the software you want to remove (
${InstallDir}
). - Stop all instances running in this directory.
- Delete the installation directory.
- Check
/etc/init.d/
,/etc/rc.d/init.d
,/sbin/init.d
,/sbin/rc3.d
,/etc/systemd/system/scheduler.service
, or/Library/LaunchDaemons
(depending on your UNIX variety). If it contains ascheduler
script orscheduler.service
unit (systemd), edit it and remove the${InstallDir}
path from the line in the beginning of the scripts containingPATHS=
. If you have no remaining installations of the Platform Agent on the machine, remove the script entirely.