Configuring the automatic startup/shutdown procedure for Control-M/EM (RedHat and Oracle Linux 7 or later)
This procedure describes how to configure the automatic startup procedure for Control-M/EM on RedHat 7 or later and Oracle Linux 7 or later.
NOTE: If there is a High Availability installation, you need to start the non-active environment, after the active environment starts.
To configure the automatic startup procedure for Control-M/EM:
- Log in as root.
- Navigate to the following to location:
/etc/systemd/system/
- Create a new unit service file with 644 permissions.
The extension must be .service.
EXAMPLE: EM.service
- Open the file and type the following:
[Unit]
Description=Control-M/EM
After=systemd-user-sessions.service multi-user.target network.target
[Service]
User=<unit_service>
ExecStart=/bin/sudo -u <user_account> /bin/csh -c "start_server; start_config_agent"
Type=forking
RemainAfterExit=yes
ExecStop=
- No High Availability: /bin/sudo -u <user_account> /bin/csh -c “[EM_home_dir]/bin/em ctl -mcs -C Config_Agent -M [hostname] -cmd shutdown"
- No High Availability with a dedicated PostgreSQL: /bin/sudo -u <user_account> /bin/csh -c “[EM_home_dir]/bin/em ctl -mcs -C Config_Agent -M [hostname] -cmd shutdown; [EM_home_dir]/bin/stop_server"
- High Availability: : /bin/sudo -u <user_account> /bin/csh -c “[EM_home_dir]/bin/em ctl -mcs -C Config_Agent -M [stand-by environment host name] -cmd shutdown; sleep 30; [EM_home_dir]/bin/em ctl -mcs -C Config_Agent -M [active environment host name] -cmd shutdown"
- High Availability with a dedicated PosgreSQL: /bin/sudo -u <user_account> /bin/csh -c “[EM_home_dir]/bin/em ctl -mcs -C Config_Agent –M [stand-by environment host name] -cmd shutdown; sleep 30; [EM_home_dir]/bin/em ctl -mcs -C Config_Agent -M [active environment host name] -cmd shutdown; [EM_home_dir]/bin/stop_server"
[Install]
WantedBy=multi-user.target
- Save the file.
- From a command line, run the following commands:
- systemctl daemon-reload
- systemctl enable [unit service file].service
- Restart the Control-M/EM computer.