Unable to start DA and DC after an upgrade from 22.2.5 to 22.2.7 due to 'setpriv' used in startup script
search cancel

Unable to start DA and DC after an upgrade from 22.2.5 to 22.2.7 due to 'setpriv' used in startup script

book

Article ID: 263964

calendar_today

Updated On:

Products

CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

Unable to start DA after upgrade from 22.2.5 to 22.2.7

[root@hostname ~]# systemctl status dadaemon.service
‚óŹ dadaemon.service - Data Aggregator
   Loaded: loaded (/etc/systemd/system/dadaemon.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-04-12 18:51:02 CDT; 15h ago
  Process: 21894 ExecStart=/apps/IMDataAggregator/scripts/dadaemon start sysd (code=exited, status=1/FAILURE)
 Main PID: 1262 (code=killed, signal=TERM)

Apr 12 18:51:02 hostname dadaemon[21894]: Starting Apache ActiveMQ.
Apr 12 18:51:02 hostname dadaemon[21894]: Starting Data Aggregator.
Apr 12 18:51:02 hostname dadaemon[21894]: CEF:0|Broadcom|DX NetOps Data Aggregator|22.2.7.747|100|STARTING SERVICE|...6a0078
Apr 12 18:51:02 hostname dadaemon[21894]: setpriv: failed to parse reuid: 'NON-ROOT USER'
Apr 12 18:51:02 hostname dadaemon[21894]: Error starting the Data Aggregator, error code=1
Apr 12 18:51:02 hostname dadaemon[21894]: CEF:0|Broadcom|DX NetOps Data Aggregator|22.2.7.747|200|FAILED TO START S...6a0078
Apr 12 18:51:02 hostname systemd[1]: dadaemon.service: control process exited, code=exited status=1
Apr 12 18:51:02 hostname systemd[1]: Failed to start Data Aggregator.
Apr 12 18:51:02 hostname systemd[1]: Unit dadaemon.service entered failed state.
Apr 12 18:51:02 hostname systemd[1]: dadaemon.service failed.

 

 

 

Environment

Issue applies to Redhat/Centos 7.x

Issue could be seen after upgrading from any version of PM to 22.2.7.

Cause

PM 22.2.7 is now using setpriv instead of runuser for a non-root setup (using sudo)

Under RHEL 7.x (and analogs), the syntax for setpriv needs to be adjusted appropriately.

Resolution

On the DA do the following:

1. Update /opt/IMDataAggregator/scripts/dadaemon

2. Change:


setpriv --reuid "${dauser}" --regid=$(id "${dauser}" -g) --init-groups ${KARAF_HOME}/bin/start
to:
setpriv --reuid=$(id "${dauser}" -u) --regid=$(id "${dauser}" -g) --keep-groups ${KARAF_HOME}/bin/start

setpriv --reuid "${dauser}" --regid=$(id "${dauser}" -g) --init-groups ${KARAF_HOME}/bin/stop
to:
setpriv --reuid=$(id "${dauser}" -u) --regid=$(id "${dauser}" -g) --keep-groups ${KARAF_HOME}/bin/stop

 

On the DC do the following:

1. Update /opt/IMDataCollector/scripts/dcmd

2. Change

setpriv --reuid "${DCM_USER}" --regid=$(id "${DCM_USER}" -g) --init-groups $rootInstance/bin/start
to:
setpriv --reuid=$(id "${DCM_USER}" -u) --regid=$(id "${DCM_USER}" -g) --keep-groups $rootInstance/bin/start

setpriv --reuid "${DCM_USER}" --regid=$(id "${DCM_USER}" -g) --init-groups $rootInstance/bin/stop
to:
setpriv --reuid=$(id "${DCM_USER}" -u) --regid=$(id "${DCM_USER}" -g) --keep-groups $rootInstance/bin/stop

 

The DA and DC(s) should now start and stop correctly.