-
Notifications
You must be signed in to change notification settings - Fork 6
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on macOS, threebot server won't start without sudo #3116
Comments
@xmonader @abom @OmarElawady after we start the server if we check the Nginx master process, using in linux$ ps aux | egrep '[n]ginx.*-c'
sameh 3526378 0.0 0.0 11648 9280 pts/5 S+ 11:13 0:00 nginx: master process startupcmd_nginx_main -c /home/sameh/sandbox/cfg/nginx/main/nginx.conf in macOS and the threebot server running with
|
return r"nginx.* \-c {CONFIG_PATH}".format(CONFIG_PATH=j.sals.fs.expanduser(self.config_path)) |
so in mac, when our startupcmd
try to make sure the Nginx started successfully using the above regex, he uses the process sal to match
rnginx.* \-c /Users/sameh/sandbox/cfg/nginx/main/nginx.conf
with nginx: master process startupcmd_nginx_main -c /Users/sameh/sandbox/cfg/nginx/main/ng XPC_FLAGS=0x0
which doesn't match because the truncated cmdline.
i was able to start the server without sudo
with this change below to regex. (but in general, I don't like using a magic number in the code or fixing the symptoms instead of the root caused).
return r"nginx.* \-c {CONFIG_PATH:.38}".format(CONFIG_PATH=j.sals.fs.expanduser(self.config_path))
which will now match correctly rnginx.* \-c /Users/sameh/sandbox/cfg/nginx/main/ng
with nginx: master process startupcmd_nginx_main -c /Users/sameh/sandbox/cfg/nginx/main/ng XPC_FLAGS=0x0
, and it works.
any thoughts?
also, instead of using the regex and match with the process cmd line, I think it's better to use the PID file specified in our |
Checking the process pid looks like a cleaner solution for nginx. There was a similar issue on Solaris that was fixed by peaking on the process memory, would be good to know if there's a similar workaround for MacOS to make the regex method work. |
@OmarElawady I think psutil is currently doing that by using sysctl system call. The problem is that we get some inconsistent output, that's why the PID check is a better solution for now IMHO. |
@OmarElawady @abom this why running our server as a privileged user will get the full cmd line on macOS. I assume peaking on the process memory already implemented but required the user to have enough permissions. glad you both agreed on using the PID solution. |
Description
on macOS, threebot server won't start without
sudo
This comment has useful debug/trace info also #3116 (comment)
Version information
Installation method
as documented on our wiki
Steps to reproduce
1- activate the env
2- start the server with
Traceback/Logs/Alerts
The text was updated successfully, but these errors were encountered: