garden / tree

A multiplayer file system
https://thefiletree.com
European Union Public License 1.2
70 stars 23 forks source link

Makefile: +w rights to log file. (#141) #142

Closed espadrine closed 12 years ago

jankeromnes commented 12 years ago

I still don't understand how you and @davidaparicio manage to make it work. I can't believe it currently works on thefiletree.com.

On my machine, it says stop start and then crashes. I made a fresh clone of garden on thefiletree.com's server (folder garden). When I do make or make PORT=7894 or whatever, it never works. @espadrine can you check?

espadrine commented 12 years ago

@jankeromnes what does "work" mean? Can you be more specific about what you see? Did you see my comment about make putting the process in the background from now on?

jankeromnes commented 12 years ago

Oh ok, that explains it. But I believe this is not an intuitive output:

$ make PORT=4561
stop
start
$ #???
espadrine commented 12 years ago

What do you expect?

$ make PORT=4224
stop
start
no, really, it's started, you can look at it!
$ 
jankeromnes commented 12 years ago

Well there is absolutely no difference between the output when it crashes and the output when it actually works.

espadrine commented 12 years ago

When it crashes, it's supposed to print the error message. Do you have a case of a crash without any error message?

jankeromnes commented 12 years ago

Also the .pid file is still created if the server crashes, and the next time you do make it will say kill: No such process.

For instance, on this machine I have apache running on port 80. I do:

$ make
stop
start

$ # the server is not started because port 80 is taken

Afterwards, I realize my mistake, and do:

$ make PORT=7894
stop
kill: No such process
start
sh: tree.log: Permission denied # unrelated error fixed by this pull request
espadrine commented 12 years ago

@jankeromnes can you pull the commit corresponding to this very pull request (not to be confused with issue #141) and tell me whether the tree.log: Permission denied error persists?

I'll look at trying to detect whether the port is taken.

jankeromnes commented 12 years ago

It seems that the empty line after start means that there was an error. Additional issue, the Makefile doesn't auto-prompt for sudo password anymore:

$ make PORT=81
stop
start

$ # no can do

EDIT: but I can confirm this pull request solves the tree.log issue.

espadrine commented 12 years ago

The fact that the Makefile doesn't prompt for sudo when it doesn't need to is something I worked quite hard to achieve.

jankeromnes commented 12 years ago

Are you sure it prompts every time it really needs it?

espadrine commented 12 years ago

yep.

It turns out it reprompts when you redirect its command's stdout and stderr, which can be tricked (which I did).

I believe this is caused by sudo using those to keep a reference to the corresponding process it spawns.

jankeromnes commented 12 years ago

then in you I trust