Trouble setting up a mbsync.timer file w/ systemd --user.
I'm trying to set up a mbsync.timer file using 'systemd --user' and I keep getting an error. I'd really appreciate it if someone could give me some pointers or help me spot the problem. After adding the files at the bottom of this post, I ran the folowing:
systemctl --user daemon-reload
systemctl --user start mbsync
and got the following:
Failed to start mbsync.service: Unit mbsync.service failed to load: No such file or directory.
when I run
systemctl --user status
it says:
State: degraded
Jobs: 0 queued
Failed: 1 units
~/.config/systemd/user/mbsync@.service:
[Unit]
Description=Sync with IMAP server(s): %i
[Service]
Type=simple
ExecStart=/usr/bin/mbsync -q %i
~/.config/systemd/user/mbsync@.timer:
[Unit]
Description=Sync mailboxes with %i
[Timer]
OnCalendar=*-*-* *:*:00
Edited 9 Jan 2015. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 2 · 100% up
- Kind
- Text
- ID
- 2rt4ke
9 comments
timers must be enabled
mbsync needs to be run with something after that @ symbol! You have to say systemctl --user start mbsync@something for it to pass in something for that %i
So I would imagine you'd do something like:
systemctl --user enable mbsync@myimapserver.timer
Thank you, this got it working! Now I just need to set up a gpg-agent service file for unlocking my subkey to unlock the encrypted account password, and I should be good to go. This may end up making a good wiki entry...
See my thread on the bbs: https://bbs.archlinux.org/viewtopic.php?id=190327
Look at my last post, it's how to get gpg-agent working in systemd.. maybe you could get the subkey working starting from that?
Try saving your timer unit in /etc/systemd/user and enable it with $systemctl enable <timer unit name>
This will symlink it into ~/.config/.........
I would suggest ignoring this suggestion, the $XDG* dirs were something that lennart directly worked on, systemd supports them extremely well.
Certainly understand your thinking here, but here are my thoughts on that:
Placing the unit in /etc/systemd/user allows you to enable/disable the service/timer as need be whereas placing it in ~/.config/systemd/user it will always be enabled.
With the unit in ~/.config/systemd/user should you accidentally systemctl disable the unit/timer, I gather the file will be deleted from ~/.config/systemd/user (essentially what disabling does) resulting in your file being permanently lost.
Cheers.
Wouldn't
systemctl --user enable mbsync.servicein the same directory as the service file do the same thing without root permissions for /etcd/systemd/user ?This is off the top of my head. I'll confirm when I get home. I have a timer unit setup for checking inboxes