Systemd Service for Offlineimap + gpg encrypted PW's inside tmux works manually after system start but not autmoatically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everybody :)

## Short description, what i'm searching for:
I want to have a detached tmux session automatically started as a systemd user service. Inside that, offlineimap should start and decrypt my login credentials. The graphical variant of pinentry should ask me for the password for decrypting my login credentials, when I attach to the session.
For managing my login credentials, I use the program 'pass' ( https://www.passwordstore.org/ ).

## What I've got so far:
The desired Behavior works perfectly and reproducibly (starting from reboot), when i start the user service after I've logged into my system.

But unfortunately it doesn't work when I do "symstemctl --user enable mail.service" and reboot:

 $ systemctl --user status mail
● mail.service - load offlineimap for all mail accounts inside tmux
   Loaded: loaded (/home/toogley/.dotfiles/systemd/user/mail.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

 $ tmux attach-session -t mail
can't find session mail

I have no idea, what i could analyze or what might be the reason. Does somebody has tips how to address this issue?

Thanks a lot!

Tobias/toogley


#=======[ mail.service ]========
Description=load offlineimap for all mail accounts inside tmux
After=network.target graphical.target
Requires=gpg-agent.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/tmux new-session -d -s mail -n dev 'export GPG_TTY=$(tty) && \
offlineimap'
ExecStop=/usr/bin/tmux kill-window -t mail
ExecReload=/usr/bin/kill -s USR1 $(pgrep offlineimap)

[Install]
WantedBy=graphical.target
#---------------------------------------------------------
#=======[ gpg-agent service ]========
[Unit]
Description=GnuPG private key agent
IgnoreOnIsolate=true

[Service]
Type=forking
ExecStart=/usr/bin/gpg-agent --daemon --homedir=%h/.gnupg
ExecStop=/usr/bin/pkill gpg-agent
Restart=on-abort

[Install]
WantedBy=default.target
#---------------------------------------------------------

#========[ ~/.offlineimaprc ]======
[general]
accounts = dev
ui = ttyui
metadata = ~/.dev_offimap
pythonfile=~/.dotfiles/mutt/accounts/decrypt.py

[Account dev]
synclabels = yes
localrepository = dev-local
remoterepository = dev-remote
status_backend = sqlite
autorefresh = 1
quick = 10

[Repository dev-local]
type = Maildir
localfolders = ~/mail/dev/

[Repository dev-remote]
remotepasseval = get_pass("toogley@xxxxxxxxxxx")
ssl = yes
type = IMAP
remotehost = imap.mailbox.org
remoteuser = toogley@xxxxxxxxxxx
sslcacertfile = /etc/ssl/certs/ca-bundle.crt
keepalive = 60
holdconnectionopen = yes
#---------------------------------------------------------
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux