microsoft / omi

Open Management Infrastructure
Other
360 stars 114 forks source link

Issues with logrotate after upgrading OMI #708

Closed norman-smith closed 2 years ago

norman-smith commented 2 years ago

Hi,

I have a problem with my Wildfly application servers logging when the omi server is running. It seems to be permission related as the log file being created is owned by root and not the wildfly user. The problem resolves itself when the omi server is stopped.

Could you possibly assist with determining what would cause this problem.

Kind Regards Norman

JumpingYang001 commented 2 years ago

@norman-smith will your wildfly app read omi logs? I didn't use wildfly app, and omi logs owns by root.

# ls -al /var/opt/omi/log
total 16
drwxr-xr-x 2 omi  omi  4096 ott  8 09:45 .
drwxr-xr-x 8 root root 4096 set 18 10:35 ..
-rw-r--r-- 1 root root    0 set 24 07:43 omiagent.root.root.log
-rw-r--r-- 1 root root  177 ott  8 09:45 omi-logrotate.status
-rw-r--r-- 1 root root 1292 set 28 12:02 omiserver.log

but if you stop the omi server, the logs still exist and own by root, so that seems not the reason?

norman-smith commented 2 years ago

@JumpingYang001 here is what happens when omiserver is started. This is a directory listing of my logs folder.

image

The owner of the generated log is changed to root.

norman-smith commented 2 years ago

When I stop the omiserver process then the following happens. image

This seems to occur only on my Red Hat servers running Wildfly. I have OMI installed on 300 plus Linux servers and only 12 of them have this problem.

JumpingYang001 commented 2 years ago

@norman-smith what is server.log? in which location? which product generate it? and converis is the user of wildfly?

norman-smith commented 2 years ago

server.log is my Wildfly log file. in /opt/converis/wildfly . The product is Wildfly (JBoss). Yes converis is the wildfly user.

JumpingYang001 commented 2 years ago

@norman-smith can you run /opt/omi/bin/omicli ei root/scx SCX_Application_Server on the box?

norman-smith commented 2 years ago

sure I can, should SCX_Application_Server be the server name?

JumpingYang001 commented 2 years ago

no, it is a fixed query, just run it when omi is running.

norman-smith commented 2 years ago

instance of SCX_Application_Server { Caption=SCX Application Server Description=Represents a JEE Application Server [Key] Name=/opt/converis/tomcat/ HttpPort=9080 HttpsPort= Port= Protocol= Version=9.0.36.0 MajorVersion=9 DiskPath=/opt/converis/tomcat/ Type=Tomcat Profile= Cell= Node= Server= IsDeepMonitored=false IsRunning=true } instance of SCX_Application_Server { Caption=SCX Application Server Description=Represents a JEE Application Server [Key] Name=/opt/converis/wildfly/standalone/configuration/ HttpPort=8080 HttpsPort=8443 Port= Protocol= Version=WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) MajorVersion=10 DiskPath=/opt/converis/wildfly/standalone/configuration/ Type=JBoss Profile= Cell= Node= Server= IsDeepMonitored=false IsRunning=true }

JumpingYang001 commented 2 years ago

it seems be related to this part: https://github.com/microsoft/SCXcore/tree/master/source/code/providers/support/appserver I guess when omiserver is started, scxcore run with omiagent as root will read app server configurations from xml, and maybe in some place it read/write Wildfly log file? I didn't touch this part of code, will check it.

norman-smith commented 2 years ago

Thanks so much for the support.

norman-smith commented 2 years ago

I can confirm that it existed in previous versions of OMI as well. Not all of them though. But the version prior to the OMIGOD patch didn't do it at all.

JumpingYang001 commented 2 years ago

@norman-smith do you mean the version before patch, it works fine and not have the permission issue?

norman-smith commented 2 years ago

Correct

JumpingYang001 commented 2 years ago

@norman-smith I also find the server.log size in screenshot is 98 for root, can you cat the file content? you can also cat /var/opt/microsoft/scx/log/scx.log to check if any strange information related to jboss or wildfly.

norman-smith commented 2 years ago
norman-smith commented 2 years ago

2021-10-08 10:17:22,440 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code 1

JumpingYang001 commented 2 years ago

@norman-smith thanks for these information! we will check and think.

norman-smith commented 2 years ago

Thank you, it is much appreciated.

JumpingYang001 commented 2 years ago

@norman-smith could you send a test email to me? I would like to discuss more details about the issue, thanks. my email: v-zhenpy@microsoft.com

norman-smith commented 1 month ago

Hi @JumpingYang001

I hope you are well. We seem to be experiencing this problem again and I would like to reopen this ticket to try and resolve this again please.

Kind regards Norman