OpenIM Server Version
3.8.1
Operating System and CPU Architecture
macOS (ARM)
Deployment Method
Source Code Deployment
Bug Description and Steps to Reproduce
If the project's directory is included in a symbolic link directory, after running mage start in the OpenIM project, CheckBinariesRunning(in CheckAndReportBinariesStatus) cannot correctly check the number of processes. The reason is that in the init function of the mageutil module, the value of the OpenIMRoot variable is obtained via os.Getwd(), which may return a path containing symbolic links, rather than the actual file path. But the underlying implementation of CheckBinariesRunning is based on the proc_pidpath function in C, which retrieves the process path as the true file path (not symbolic link paths).
It will also make the "mage stop" not work to stop processes.
It is recommended to modify the package's init function
func init() {
currentDir, err := os.Getwd()
if err != nil {
panic("Error getting current directory: " + err.Error())
}
OpenIMRoot = currentDir
to
func init() {
currentDir, err := os.Getwd()
if err != nil {
panic("Error getting current directory: " + err.Error())
}
currentDir, err = filepath.EvalSymlinks(currentDir)
if err != nil {
panic("Error resolving symlinks in current directory: " + err.Error())
}
OpenIMRoot = currentDir
Screenshots Link
No response