You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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())
}
currentDir, err = filepath.EvalSymlinks(currentDir)
if err != nil {
panic("Error resolving symlinks in current directory: " + err.Error())
}
OpenIMRoot = currentDir
Screenshots Link
No response
The text was updated successfully, but these errors were encountered:
neptunezx
changed the title
[BUG] function CheckAndReportBinariesStatus cannot correctly check the number of processes when meet symbolic link directory
[BUG] function CheckAndReportBinariesStatus cannot correctly check the number of processes when encountering symbolic link directory situation
Nov 7, 2024
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
to
Screenshots Link
No response
The text was updated successfully, but these errors were encountered: