Giter VIP home page Giter VIP logo

Comments (8)

reidrac avatar reidrac commented on August 21, 2024

The pidfile is used as a lock to avoid two instances running at the same time.

The example configuration file is probably wrong as it says:

  • default: empty; not correct as we use a default pid name.
  • Pid file location when in daemon mode; not correct as we always create the pid file.

I'll make a bug report for that.

Regarding you question, I don't see the problem. upstart doesn't use pidfiles, but that doesn't mean you can start n instances of the same service trying to bind to the same port, and preventing that is one of the uses of the pidfile.

More information would be appreciated!

from sftpcloudfs.

kvdveer avatar kvdveer commented on August 21, 2024

IMHO, multiple daemons should be perfectly acceptable, as long as they listen to different sockets. The listening socket already acts as a mutex. The pidfile just reimplements that mutexing behaviour with files instead of sockets.

The main issue I have is that the current implementation doesn't deal with stale pidfiles. This isn't a problem as start-stop-daemon tends to deal with it by checking if the pidfile actually represents a valid running process. However, upstart doesn't manage the stale pidfile (it doesn't do pidfiles at all), so after an unclean shutdown, the daemon refuses to start due to a stale pidfile.

from sftpcloudfs.

reidrac avatar reidrac commented on August 21, 2024

There's no problem with that, but you need to specify different configuration files or CLI options (and hence different pidfiles should configured).

The pidfile provides a lock mechanism that is not equivalent to your operating system reporting an error binding to a port already in use.

If there's a stale pidfile that means the process is not being shutdown properly (otherwise it would be removed), and you should investigate that (no matter what we decide here!). Besides you may want to run the service using expect daemon (or similar, I'm not upstart expert), instead of using the foreground mode (that is intended only for troubleshooting).

I like that the pidfile has a default, and I never had a problem with it because the service always ends correctly, but getting back to you request, we could accept that no pidfile is created if it's not configured.

Take a look to this and tell me if it works for you:

https://github.com/Memset/sftpcloudfs/tree/no-pidfile

Thanks for your report!

from sftpcloudfs.

kvdveer avatar kvdveer commented on August 21, 2024

With correct documentation on the output, I would've created a working upstart script first time round, so that definitely helps. I still disagree on the purpose of a pidfile, but that's not really important.

If --foreground is only intended for debugging, you may want to include that in the documentation, too.

Are you by any chance interested in the resulting upstart configuration?

from sftpcloudfs.

reidrac avatar reidrac commented on August 21, 2024

We don't provide support for any init or process management system (we use classic init scripts mostly, although we have some deployments with supervisord).

Let me know if you like my proposal and I'll merge the changes.

from sftpcloudfs.

reidrac avatar reidrac commented on August 21, 2024

Yes, the foreground mode is not intended for production. If you use ftpcloudfs some functionality is not (or wasn't) even available because of limitations of that mode (not sftpcloufds case as paramiko does most of the heavy lifting).

from sftpcloudfs.

kvdveer avatar kvdveer commented on August 21, 2024

The proposed change looks good to me, thank you.

from sftpcloudfs.

reidrac avatar reidrac commented on August 21, 2024

Sorry about the docs not being completely clear. You can submit a pull request if you feel anything can be improved!

from sftpcloudfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.