@@ -320,6 +320,18 @@ installBundleForDebianDistro() {
320320 systemctl restart nginx
321321}
322322
323+ check_restorecon (){
324+ local path=" $1 "
325+
326+ if ! sudo restorecon -F -R " $path " ; then
327+ YELLOW=' \033[1;33m'
328+ NC=' \033[0m'
329+ echo -e " ${YELLOW} WARNING: Something happened${NC} "
330+ else
331+ echo " restorecon succeeded for $path "
332+ fi
333+ }
334+
323335installBundleForRPMDistro (){
324336 # creating nms group and nms user if it isn't already there
325337 if ! getent group " ${NIM_GROUP} " > /dev/null; then
@@ -352,19 +364,17 @@ installBundleForRPMDistro(){
352364 rm -f /etc/yum.repos.d/nginx-plus.repo
353365 fi
354366 printf " [nginx-plus]\nname=nginx-plus repo\nbaseurl=https://pkgs.nginx.com/plus/$os_type /\$ releasever/\$ basearch/\nsslclientcert=/etc/ssl/nginx/nginx-repo.crt\nsslclientkey=/etc/ssl/nginx/nginx-repo.key\ngpgcheck=0\nenabled=1" >> /etc/yum.repos.d/nginx-plus.repo
355-
356- yum install -y yum-utils curl epel-release ca-certificates
357- yum-config-manager --enable nginx-stable
358- yum-config-manager --enable nginx-plus
359-
367+
360368 yum -y update
361369 check_last_command_status " yum update" $?
362-
370+
371+ yum install -y yum-utils curl epel-release ca-certificates
372+
363373 if [ " ${USE_NGINX_PLUS} " == " true" ]; then
364374 echo " Installing nginx plus..."
365375 yum install -y nginx-plus
366376 check_last_command_status " yum install -y nginx-plus" $?
367- createNginxMgmtFile
377+ create_nginx_mgmt_file
368378 else
369379 echo " Installing nginx..."
370380 yum install -y nginx --repo nginx-stable
@@ -375,7 +385,7 @@ installBundleForRPMDistro(){
375385 check_last_command_status " systemctl enable nginx.service" $?
376386
377387 if [[ ${SKIP_CLICKHOUSE_INSTALL} == " false" ]]; then
378- yum- config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
388+ dnf config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
379389 echo " Installing clickhouse-server and clickhouse-client"
380390
381391 yum install -y " clickhouse-common-static-${CLICKHOUSE_VERSION} "
@@ -416,6 +426,30 @@ installBundleForRPMDistro(){
416426 sleep 5
417427 echo " Restarting nginx API gateway"
418428 systemctl restart nginx
429+
430+ sleep 2
431+ check_restorecon /usr/bin/nms-core
432+ check_restorecon /usr/bin/nms-dpm
433+ check_restorecon /usr/bin/nms-ingestion
434+ check_restorecon /usr/bin/nms-integrations
435+ check_restorecon /usr/bin/nms-sm
436+ check_restorecon /usr/lib/systemd/system/nms.service
437+ check_restorecon /usr/lib/systemd/system/nms-core.service
438+ check_restorecon /usr/lib/systemd/system/nms-dpm.service
439+ check_restorecon /usr/lib/systemd/system/nms-sm.service
440+ check_restorecon /usr/lib/systemd/system/nms-ingestion.service
441+ check_restorecon /usr/lib/systemd/system/nms-integrations.service
442+ check_restorecon /var/lib/nms/modules/manager.json
443+ check_restorecon /var/lib/nms/modules.json
444+ check_restorecon /var/lib/nms/secrets
445+ check_restorecon /var/lib/nms/streaming
446+ check_restorecon /var/lib/nms
447+ check_restorecon /var/lib/nms/dqlite
448+ check_restorecon /var/run/nms
449+ check_restorecon /var/lib/nms/modules
450+ check_restorecon /var/log/nms
451+
452+ sleep 5
419453}
420454
421455install_nim_online (){
@@ -450,7 +484,6 @@ check_nim_dashboard_status(){
450484 sleep 60
451485 if ! curl -k -v https://localhost/ui/ 2> /dev/null| grep -q " NGINX" ; then
452486 echo " NGINX Instance Manager failed to start"
453- cat /var/log/nms/nms.log
454487 exit 1
455488 else
456489 echo -e " ${GREEN} NGINX Instance Manager Successfully Started${NC} "
@@ -810,7 +843,7 @@ printSupportedOS(){
810843 printf " \n 5. debian12(bookworm)"
811844 printf " \n 6. centos8(CentOS 8)"
812845 printf " \n 7. rhel8(Redhat Enterprise Linux Version 8)"
813- printf " \n 8. rhel9( Redhat Enterprise Linux Version 9)"
846+ printf " \n 8. rhel9(Redhat Enterprise Linux Version 9)"
814847 printf " \n 9. oracle8(Oracle Linux Version 8)"
815848 printf " \n 10. oracle9(Oracle Linux Version 9)\n"
816849 exit 0
0 commit comments