Search code examples
perlsocketsremote-servermojolicious

How to open socket for Hypnotoad


Trying to give mojolicious apps a try but having difficulty running them from the server with hypnotoad.

[user@server public_html]$ hypnotoad -t app/script/app 
Everything looks good!
[user@server public_html]$ hypnotoad app/script/app 
Can't create listen socket: Address already in use at /usr/local/share/perl5/Mojo/IOLoop.pm line 126.

It would appear that everything is in place to be able to start app in hypnotoad but this doesn't work. How would one go about closing whatever is stopping mojolicous from listening on the socket? Or is there a better way to solve this?


Solution

  • With netstat you can find PID of process holding 8080 port, and send SIGTERM to stop it,

    netstat -lntp | perl -nE '/:8080/ or next; say and kill(15, $_) for m|(\d+)/|'