How To Start PAMSC Last with Systemctl
search cancel

How To Start PAMSC Last with Systemctl

book

Article ID: 219716

calendar_today

Updated On:

Products

CA Privileged Identity Management Endpoint (PIM)

Issue/Introduction

To avoid a potential conflict with another product, it may be required to have PAMSC start last with systemctl. Follow the steps below to set up a systemctl script for PAMSC to start last.

Environment

PAM Server Control 14.x

Resolution

1. Create a new target, called post-multi-user.target (You may want to review all /lib/systemd/system/*.target files to see how targets are configured.)
# cd /etc/systemd/system
# vi post-multi-user.target
[Unit]
Description=Post Multi-user Target
Requires=multi-user.target
After=multi-user.target
AllowIsolate=yes

2. Create a unit file for PAMSC, called seos.service (or modify the current one to match)
# cd /etc/systemd/system
# vi seos.service
[Unit]
Description=CA Privileged Access Manager Server Control
After=multi-user.target
[Service]
Type=forking
ExecStart=/opt/CA/PAMSC/bin/seload
ExecStop=/opt/CA/PAMSC/bin/secons -sk
ExecStopPost=/opt/CA/PAMSC/bin/SEOS_load -u
[Install]
WantedBy=post-multi-user.target

3. Create post-multi-user.target.wants
# cd /etc/systemd/system
# mkdir post-multi-user.target.wants
# cd post-multi-user.target.wants
# ln -s /etc/systemd/system/seos.service /etc/systemd/system/post-multi-user.target.wants/seos.service

4. Make post-multi-user.target the default target (By default, the multi-user.target is the default target.)
# cd /etc/systemd/system
# systemctl list-units --type target --all
# systemctl get-default
# systemctl set-default post-multi-user.target

5. Make sure seos.service is enabled
# systemctl enable seos.service

6. Switch to post-multi-user.target (runlevel) or reboot
# systemctl isolate post-multi-user.target
or
# systemctl reboot

7. To check if PAMSC is started accordingly, switch target level from post-multi-user.target to multi-user.target to see if PAMSC will be stopped.
# systemctl isolate multi-user.target