lestrrat-go / server-starter

Go port of start_server utility (Server::Starter)
MIT License
215 stars 21 forks source link

how to hot deploy web application which is a binary file #13

Closed willsun888 closed 7 years ago

willsun888 commented 7 years ago

my web application is built into a binary file, if I reploy it, I must cover the binary file. But, the binary file is execting, so I can't cover it, it will cause "cannot create regular file `xxxx': Text file busy"

lestrrat commented 7 years ago

Sorry, I do not understand what you are trying to explain. Probably better if you showed me exactly what you are doing.

HOWEVER: the fact that you are saying "binary file..." seems to indicate that you are trying to use a random executable under server-starter, which is so not the point. You need to have a program that explicitly supports server-starter. You can't just hot deploy random executables.

willsun888 commented 7 years ago

I build my web application with "go build -o xxxx", if I use go-server-starter to start xxxx, xxxx is under excuting status and xxxx can't be cover with a new version file. So I can't deploy my new version web app before restart it gracefully

willsun888 commented 7 years ago

I just want to deploy a new version web appliction file and restart it gracefully, but go-server-starter can't do this

lestrrat commented 7 years ago

no, that's not how you use it. the program must use the FD that gets passed in the environment. in the README:

image

And you need to understand how the original works: https://metacpan.org/pod/Server::Starter And maybe this (note, I didn't write it, and I haven't really read it): http://takeshiyako.blogspot.jp/2015/10/go-lang-hot-deploy-with-go-server-starter.html