Giter Site home page Giter Site logo

Comments (12)

jk1 avatar jk1 commented on August 10, 2024

Done

from pochta.

ctapobep avatar ctapobep commented on August 10, 2024
  • The script should create a PID file when starting in order to finish pochta correctly during stop.
  • Also, CentOS uses chkconfig utility for services, current file cannot be understood by this utility

Could you please also add a restart command that runs stop && start afterwards?

from pochta.

jk1 avatar jk1 commented on August 10, 2024

Currently it can perform stop without any pid-files. Why do we need to create one?

from pochta.

ctapobep avatar ctapobep commented on August 10, 2024

Because it's fragile (won't work if there are several PIDs with 'pochta' in its name, this includes su pochta) & risky (can potentially kill wrong pids).

from pochta.

jk1 avatar jk1 commented on August 10, 2024

This makes sense. Script has been updated to user pid. I'm not quite sure that ~/.pochta/pid is the best place for pid-file, but at least we have no permission problems there. Suggestions are most welcomed, as usual.

from pochta.

masyan avatar masyan commented on August 10, 2024

/var/run/pochta to PID file, and set permissions to dir (/var/run/pochta)

from pochta.

jk1 avatar jk1 commented on August 10, 2024

changed pid location to /var/run/pochta

from pochta.

ctapobep avatar ctapobep commented on August 10, 2024

There is still no chkconfig support. It requires a line like chkconfig: - 85 15. Also, in a guide there are no installation instructions for chkconfig.

from pochta.

ctapobep avatar ctapobep commented on August 10, 2024

Several notes:

  • PID is created even if service failed to start
  • After start, the script should finish (right now it waits for ctrl+c which doesn't allow running it from CI)
  • If we don't have permissions to write into /var/run, a respective error should be shown and we should terminate the startup.
  • Would be useful to log into .jtalks or into /var/logs/pochta folders

from pochta.

jk1 avatar jk1 commented on August 10, 2024

PID is created even if service failed to start
After start, the script should finish (right now it waits for ctrl+c which doesn't allow running it from CI)
If we don't have permissions to write into /var/run, a respective error should be shown and we should terminate the startup.

fixed

Would be useful to log into .jtalks or into /var/logs/pochta folders

Application level logging will be implemented soon, so I see no reason to address logging issues in scope of the service script

from pochta.

ctapobep avatar ctapobep commented on August 10, 2024

I tried the latest version of script, there appears to be an issue with restarting. Server doesn't catch up with the script, so when new instance of Pochta starts, the previous instance is still listening on the port:

[pochta@dev ~]$ service pochta restart
Stopping Pochta service...
Service stopped
Starting Pochta service...
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.jtalks.pochta.PochtaPackage-main-cba84353.main(main.kt:15)
    at org.jtalks.pochta.PochtaPackage.main(main.kt:1)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.net.httpserver.ServerImpl.bind(ServerImpl.java:133)
    at sun.net.httpserver.HttpServerImpl.bind(HttpServerImpl.java:54)
    at org.jtalks.pochta.http.HttpServer.<init>(HttpServer.kt:25)
    at org.jtalks.pochta.http.HttpServer.<clinit>(HttpServer.kt)
    ... 2 more

Also, note that this doesn't return error code:

[pochta@dev ~]$ echo $?
0

from pochta.

jk1 avatar jk1 commented on August 10, 2024

It seems to be an application issue with TCP ports not being released properly. Please recheck it, now it should be fine.

from pochta.

Related Issues (13)

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.