-
Notifications
You must be signed in to change notification settings - Fork 46
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
syncthingtray PKGBUILD fails to build if port 4001 is not available #57
Comments
The testsuite actually starts a Syncthing instance and uses port 4001 for that by default. The port can be altered by setting the environment variable Of course you could also just skip the tests using Maybe I should set the default port to a less common number. |
I think the best way is to find a random unused port and test with it, here is a fast bash function that I use for that puprose, maybe it will help: function EPHYMERAL_PORT(){
LPORT=32768;
UPORT=60999;
while true; do
MPORT=$[$LPORT + ($RANDOM % $UPORT)];
(echo "" >/dev/tcp/127.0.0.1/${MPORT}) >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo $MPORT;
return 0;
fi
done
} |
Using this function to set the |
Unfortunately, I'm a bit lost when it comes to programming (I'm just an admin, but trying to learn), so I suspect any PR request I submit will be useless. |
Fixed |
When I try to build syncthingtray and port 4001 is used by another app, this happens:
When the daemon listening on 4001 is disabled it builds without problems.
The text was updated successfully, but these errors were encountered: