Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Mac下不能使用cli_set_process_title命名进程名称 #17

Open
illidan-tld opened this issue Aug 22, 2017 · 1 comment
Open

Mac下不能使用cli_set_process_title命名进程名称 #17

illidan-tld opened this issue Aug 22, 2017 · 1 comment

Comments

@illidan-tld
Copy link

illidan-tld commented Aug 22, 2017

Mac下使用cli_set_process_title报错:Warning: cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly #616,查阅了相关资料,应该是mac下安全性的问题,不允许重命名进程名称。

我的解决方案是将manager进程的pid记录到sh文件中,直接用pid来reload,这样的话可以全平台通用:

public function onStart(swoole_server $serv ) {

    @cli_set_process_title("reload_master");

    $managerPid = $serv->manager_pid;

    $shString = "echo \"Reloading...\"

    kill -USR1 {$managerPid}

    echo \"Reloaded\"";

    file_put_contents('./reload_manager.sh', $shString);

}
@LinkedDestiny
Copy link
Owner

LinkedDestiny commented Aug 22, 2017 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants