View Revisions: Issue #4934

Summary 0004934: Service won't start on Windows after enabling JMX
Revision 2022-01-12 16:42 by elong
Description From setup program, when you enable JMX, the server won't start as a service because the "security" folder needs to be owned by the user that runs the server. The service runs as user "System".

-- After install
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant %username%:(r,w,f)

-- Switching to Service
takeown /f jmxremote.password
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /reset
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant System:(r)
icacls jmxremote.password /setowner System
icacls jmxremote.password /remove %username%

-- Switching back to User
takeown /f jmxremote.password
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /reset
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant %username%:(r,w,f)

This appears to be a Windows-only issue. On Unix/Mac, we set the file permissions in security folder to 600, which seems to be enough to avoid the error -- if running the service, it defaults to root, which can still read the file and doesn't care if the owner is different.
Revision 2021-03-31 18:31 by elong
Description From setup program, when you enable JMX, the server won't start as a service because the "security" folder needs to be owned by the user that runs the server. The service runs as user "System".

-- After install
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant %username%:(r,w,f)

-- Switching to Service
takeown /f jmxremote.password
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /reset
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant System:(r)
icacls jmxremote.password /setowner System
icacls jmxremote.password /remove %username%

-- Switching back to User
takeown /f jmxremote.password
icacls jmxremote.password /setowner %username%
icacls jmxremote.password /reset
icacls jmxremote.password /inheritance:r
icacls jmxremote.password /grant %username%:(r,w,f)