You are not logged in.

#1 2024-06-18 01:25:03

naalyx
Member
Registered: 2024-06-17
Posts: 1

calling mbsync automatically systemd/User units failing

I'm following the isync wiki, I enabled the mbsync.service referenced under section 4.2.1 of the wiki. but it fails to prompt for my gpg password, It works if I first cache my password manually and then manually start the service, but that defeats the purpuse of the service. calling mbsync -a from the command line works as expected.
I also get this same problem with the service that comes with goimapnotify mentioned in section 4.2.2 of the wiki.

output of "systemctl --user status mbsync.service":

× mbsync.service - Mailbox synchronization service
     Loaded: loaded (/home/me/.config/systemd/user/mbsync.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-06-17 18:23:04 CST; 27min ago
    Process: 61331 ExecStart=/usr/bin/mbsync -Va (code=exited, status=1/FAILURE)
   Main PID: 61331 (code=exited, status=1/FAILURE)
        CPU: 251ms

Jun 17 18:23:02 pc mbsync[61331]: Opening near side store hotmail-local...
Jun 17 18:23:02 pc mbsync[61331]: Connection is now encrypted
Jun 17 18:23:02 pc mbsync[61331]: Logging in...
Jun 17 18:23:02 pc mbsync[61331]: Authenticating with SASL mechanism PLAIN...
Jun 17 18:23:04 pc mbsync[61377]: gpg: public key decryption failed: No such file or directory
Jun 17 18:23:04 pc mbsync[61377]: gpg: decryption failed: No such file or directory
Jun 17 18:23:04 pc mbsync[61331]: Skipping account hotmail, PassCmd exited with status 2
Jun 17 18:23:04 pc systemd[61321]: mbsync.service: Main process exited, code=exited, status=1/FAILURE
Jun 17 18:23:04 pc systemd[61321]: mbsync.service: Failed with result 'exit-code'.
Jun 17 18:23:04 pc systemd[61321]: Failed to start Mailbox synchronization service.

I have the following lines under .bashrc:
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null

this resolved a similar problem I was getting when calling goimapnotify manually.

and this on my ~/.gnupg/gpg-agent.conf:
pinentry-program /usr/bin/pinentry-curses

This is my first time working with systemd services. I understand environmental variables are not inherited to user units
and StandardInput defaults to /dev/null
but I don't know what environmental variables I need to set if any, or what to set StandardInput and StandardOutput to if at boot I haven't even opened a terminal
Right now my services are the same as the wiki's

Offline

Board footer

Powered by FluxBB