Skip to content
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

Can't stop server #10

Open
dgrant opened this issue Mar 26, 2014 · 27 comments
Open

Can't stop server #10

dgrant opened this issue Mar 26, 2014 · 27 comments
Labels

Comments

@dgrant
Copy link
Owner

dgrant commented Mar 26, 2014

eyefiserver2 can't be stopped using init.d script (needs to be -9'd). This only seems to apply after a photo has been uploaded. If not uploading has occurred then it will shut down.

@dgrant dgrant added the bug label Mar 26, 2014
@robin13
Copy link

robin13 commented May 30, 2014

Same for me.

@dgrant
Copy link
Owner Author

dgrant commented May 30, 2014

I haven't touched this because someone had offered to fix this, but I haven't heard from him in a long time. I'll have a look.

@mothy60
Copy link

mothy60 commented Jun 18, 2014

I've also got this problem, however I get it even if no photo has been uploaded. and even if i run the script with init.d.

@stooboy
Copy link

stooboy commented Sep 3, 2014

hello, i have the same issue but it also stops my ubuntu install from shuting down also. unbuntu 14.10 seems to happen weather a pic is uploaded or not.

@dgrant
Copy link
Owner Author

dgrant commented Sep 4, 2014

I'm working on it. I tried last night and the only solution I have so far
is to close the socket. Not pretty, but will do for bow. Hopefully I'll
have a commit in for this today for you to try.

Dave
On Sep 3, 2014 1:37 PM, "stooboy" notifications@github.com wrote:

hello, i have the same issue but it also stops my ubuntu install from
shuting down also. unbuntu 14.10 seems to happen weather a pic is uploaded
or not.


Reply to this email directly or view it on GitHub
#10 (comment).

@dgrant
Copy link
Owner Author

dgrant commented Sep 4, 2014

@dgrant
Copy link
Owner Author

dgrant commented Sep 4, 2014

This is the commit: ca62c8e

@stooboy
Copy link

stooboy commented Sep 5, 2014

Hello, I have aplied the update and although i still get the unexpected error the server does now exit, and allows my pc to shutdown. :) thanks

@dgrant
Copy link
Owner Author

dgrant commented Sep 5, 2014

What error do you get? Glad it works!
On Sep 5, 2014 4:35 AM, "stooboy" notifications@github.com wrote:

Hello, I have aplied the update and although i still get the unexpected
error the server does now exit, and allows my pc to shutdown. :) thanks


Reply to this email directly or view it on GitHub
#10 (comment).

@stooboy
Copy link

stooboy commented Sep 5, 2014

Hi,

There error was
"/etc/init.d/eyefiserver: 20: [: TRUE: unexpected operator"

and never exited, either when a picture was sent or not.

I just tried it again after a reboot and took a picture, and its not exiting.

if i take no photo and stop the server its gives the unexpected error followed with eyefi server stopped.

@leshus
Copy link

leshus commented Sep 5, 2014

No, it's not works for me...
It works only if you start the server and stop immediately... (as well exception report)

./eyefiserver.py instance eyefiserver.conf eyefiserver.log
[09/05/14 07:25PM][runEyeFi] - Reading config eyefiserver.conf
[09/05/14 07:25PM][runEyeFi] - Eye-Fi server started listening on port 59278
^C
[09/05/14 07:27PM][stop_server] - Eye-Fi server stopped 
[09/05/14 07:27PM][serve_forever] - Swallowing exception, perhaps socket closed: [Errno 9] Bad file descriptor

If you try start the server, upload photo and then stop the server it is not works...
have to call kill -9 PID

p.s. i'm also change upsyncallowedElementText = doc.createTextNode("true") again (without mod, upload not started)

System info: Ubuntu 14.04.1 (Linux 3.13.0-35-generic #62-Ubuntu x86_64 GNU/Linux)
Card info: Eye-Fi Card/5.0019

@dgrant
Copy link
Owner Author

dgrant commented Sep 9, 2014

Sorry, I guess I'll have to do some more fiddling and actually upload photos. Sorry I can't get to this right away. It's an open source project so anyone is free to help, although I realize not everyone is a coder. Thanks for your help reporting and testing.

@jharris0221
Copy link

Any progress on this? Seems to still be an issue. Appreciate you working on it!

@dukesrg
Copy link
Collaborator

dukesrg commented Oct 20, 2014

Just realized stopEyeFi() is never called, so does do_Quit in turn. Shouldn't be a shutdown() call for BaseHTTPServer instance?
Looks like all daemon and sigterm stuff is working fine but BaseHTTPServer is locking the thread.

@dgrant
Copy link
Owner Author

dgrant commented Oct 27, 2014

Any work on this is much appreciated. I spent some time on this on a branch but didn't get it completely fixed.

@dukesrg
Copy link
Collaborator

dukesrg commented Oct 28, 2014

I googled for that problem, and found that basehttpserver must be requested from the local host to exit the serve loop. Looks like QUIT method was intended to do so, but never called now. The other method was to invoke a shutdown(). the third issue may be related with the linux double fork used that sometimes result in zombifying the second one. But on the other hand serve_forever is started with tha damon and exits properly if there was not any request served and those do not looks like our case. I tried the first two workaround and it didn't work or I got an exceptios, but I'm not a Python programmer so may did a mistakes.

@dgrant
Copy link
Owner Author

dgrant commented Oct 28, 2014

I should have provided more detail. I also noticed the QUIT method which
was intended to send the request which will exit the loop but I couldn't
get it to work either.

On Mon, Oct 27, 2014 at 9:46 PM, dukesrg notifications@github.com wrote:

I googled for that problem, and found that basehttpserver must be
requested from the local host to exit the serve loop. Looks like QUIT
method was intended to do so, but never called now. The other method was to
invoke a shutdown(). the third issue may be related with the linux double
fork used that sometimes result in zombifying the second one. But on the
other hand serve_forever is started with tha damon and exits properly if
there was not any request served and those do not looks like our case. I
tried the first two workaround and it didn't work or I got an exceptios,
but I'm not a Python programmer so may did a mistakes.


Reply to this email directly or view it on GitHub
#10 (comment).

David Grant
http://www.davidgrant.ca

@prestigez
Copy link

I also get this error when I stop eyefiserver 20: [: TRUE: unexpected operator

and finally I can't stop it I have to kill process "kill -9 pid" and service eyefiserver stop after that.

@aflat
Copy link

aflat commented Jan 21, 2015

If I change line 181 from

os.kill(pid, SIGTERM)

to

os.kill(pid, signal.SIGQUIT)

It shuts down fine, and doesn't core dump either. Tested on Mint17, and Fedora 19.

@aflat
Copy link

aflat commented Jan 21, 2015

Looks like that change doesn't allow the server to stop after I upload a pic, so back to the drawing board.

@dgrant
Copy link
Owner Author

dgrant commented Jan 21, 2015

Thanks for trying. :-)
On Jan 20, 2015 8:37 PM, "George" notifications@github.com wrote:

Looks like that change doesn't allow the server to stop after I upload a
pic, so back to the drawing board.


Reply to this email directly or view it on GitHub
#10 (comment).

@aflat
Copy link

aflat commented Jan 23, 2015

Ok, not nearly as nice, it's just killing it, but that's what I have to do anyways.

os.kill(pid, 9)

works, even after I upload a picture. It does clean up the pidfile too.

@ryantm
Copy link

ryantm commented Jan 25, 2015

I can confirm that when running as an instance and doing ctrl-c after uploading a picture with this bug fix branch, it doesn't kill it.

@Sklanfurt
Copy link

Got the script running but my computer wont shut down after it started. Have to kill it everytime. Somebody got a solution for this?

@ryantm
Copy link

ryantm commented Sep 2, 2017

@Sklanfurt My solution was to write my own server. The code is at https://github.com/ryantm/heyefi

@dgrant
Copy link
Owner Author

dgrant commented Sep 6, 2017

@ryantm in Haskell! 🙌

@dgrant
Copy link
Owner Author

dgrant commented Sep 6, 2017

Yeah this bug sucks, I can't even reboot my NAS, I always have to ssh in to it and stop it before doing a reboot otherwise it will never shut down. I spend some time trying to fix it a while back and failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests