Git Product home page Git Product logo

Comments (11)

LeeiFrankJaw avatar LeeiFrankJaw commented on June 28, 2024 14

I assume that if mu server is running then Emacs is also running (mu server is started by mu4e) and Emacs server is enabled. And my way to solve the problem is the following.

#!/usr/bin/env bash
if pgrep -f 'mu server'; then
    emacsclient -e '(mu4e-update-index)'
else
    mu index
fi

from mu.

tituomin avatar tituomin commented on June 28, 2024 12

Just a tip: if you have an Emacs daemon running, you can index with mu4e using the following shell command:

emacsclient -e '(mu4e-update-index)'

from mu.

semente avatar semente commented on June 28, 2024 3

Just a important note for the readers:

The full command set to it work fine is:

pkill -2 -u $UID mu
sleep 1
mu index

The 1 second delay was needed for me. ;-)

from mu.

 avatar commented on June 28, 2024 1

Remove the ~/.mu and re-run mu index.

from mu.

djcb avatar djcb commented on June 28, 2024

The underlying database (Xapian) can be opened in read/write-mode only once... To prevent this error, you can either retrieve your mail from within mu4e (ie., 'U' in the main view), or in your cron script put something like:

pkill -2 -u $UID mu

This will sent a SIGINT to the mu process, which will then terminate gracefully. Mu4e will automatically restart mu when it is needed again (of course, you can still only have one mu at the same time, but in practice it works quite well).

from mu.

MassimoLauria avatar MassimoLauria commented on June 28, 2024

Hi Dirk-Jan,

I have a similar problem, and of course your answer clarify everything. But my setup is a little bit different:
I make offlineimap+mu run in background. But when I launch mu4e the lock is taken and mu update does not work anymore. I have to update the db manually, which is not nice (make the email reading not interactive). Is it possible to force mu4e to open the xapian database read only, and let the offlineimap daemon to run mu index?

Thank you.

from mu.

djcb avatar djcb commented on June 28, 2024

That's not possible...mu4e cannot do its job when it cannot write the database.

However, what you can do is either the pkill trick mentioned above, or in your background script check for a running mu and if there is already, let mu4e handle indexing.

from mu.

edumerco avatar edumerco commented on June 28, 2024

See also the related discussion in the list: https://groups.google.com/forum/#!searchin/mu-discuss/Keybinding$20for$20mu4e-update-index|sort:relevance/mu-discuss/MCbP8Gwiujc/kg1QA2rPAgAJ

from mu.

shackra avatar shackra commented on June 28, 2024

I was doing what @tituomin writes and from version 1.x of mu I cannot even run mu4e on Emacs.

error in process sentinel: mu4e~proc-sentinel: Database is locked by another process
error in process sentinel: Database is locked by another process

Running pkill -2 -u $UID mu on a console and then trying again yields the same result.

I swear I haven't touch my configuration of mu for Emacs or the configuration of my goimapnotify (nor touched the source code in months) and after the update to 1.x mu have been showing such behavior.

from mu.

daphniz avatar daphniz commented on June 28, 2024

Any idea how to suppress the message resulting from mu4e-update-index?
For some reason, (let ((inhibit-message t)) (mu4e-update-index)) still shows it.

I assume that if mu server is running then Emacs is also running (mu server is started by mu4e) and Emacs server is enabled. And my way to solve the problem is the following.

#!/usr/bin/env bash
if pgrep -f 'mu server'; then
    emacsclient -e '(mu4e-update-index)'
else
    mu index

from mu.

M-Stenzel avatar M-Stenzel commented on June 28, 2024

I assume that if mu server is running then Emacs is also running (mu server is started by mu4e) and Emacs server is enabled. And my way to solve the problem is the following.

#!/usr/bin/env bash
if pgrep -f 'mu server'; then
    emacsclient -e '(mu4e-update-index)'
else
    mu index
fi

Thank you,

but consider there is more than one person using mu4e simultaneously.
Then you have to check for "mu server" UID for this specific user.

Martin.

from mu.

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.