GithubHelp home page GithubHelp logo

Trigger sync on daemon stop about atuin HOT 2 OPEN

Programie avatar Programie commented on July 17, 2024
Trigger sync on daemon stop

from atuin.

Comments (2)

ellie avatar ellie commented on July 17, 2024

Hey!

I'd stick with the workaround tbh - the daemon is designed to run persistently, and not just while a session is in place.

I'd also prefer that the daemon does not try and do more work once it's been asked to exit, and instead exits immediately.

Is there any reason you're not happy to just leave the daemon running?

from atuin.

Programie avatar Programie commented on July 17, 2024

The daemon is designed to run persistently, and not just while a session is in place.

In a system using systemd, that could be done using a system-wide systemd service (i.e. not a systemd user service). But that won't work in case of multiple users on the same system. It's especially not suitable for systems where multiple users should have different Atuin accounts (not my case, but probably others also having the same issue). A single Atuin daemon running as systemd service would also just use a single Atuin account.

Is there any reason you're not happy to just leave the daemon running?

That's just by design of systemd user services. Those services are deactivated once the last session of the user is closed. In case of an SSH connection to a server, the session ends with the SSH connection being closed. And if that's the only SSH connection to the server, the systemd service gets stopped.

But as already mentioned, this results in Atuin not being able to sync the recent history entries added since the last sync.

Example:

  • I execute some commands in my SSH session
  • then at some point, the daemon syncs the history
  • then I execute a few other commands
  • I disconnect from the server before the daemon syncs the next time

The commands executed in the 3rd step of my example won't be synced until I'm connecting again.

from atuin.

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.