-
Notifications
You must be signed in to change notification settings - Fork 3
systemd support #10
Comments
|
one thing that can happen in the multiple service scenario is this: but then it will try again later... maybe there are some tweaks to work around that issue? |
|
testing the following tweak: --- i/.config/systemd/user/smd-push.service
+++ w/.config/systemd/user/smd-push.service
@@ -1,6 +1,7 @@
[Unit]
Description=push emails with syncmaildir
Wants=network.target
+After=smd-pull.service
[Service]
Type=oneshot |
|
Thanks! systemd is pretty standard these days, so it should go to the README, IMO. BTW smd-loop (or maybe smd-applet, I don't remember now) does not complain in case a network error is detected once (twice in a row). It helps when the network is unreliable. What does systemd in these case? retry? stop? |
|
network is a bit i need to work on. normally, systemd should "know" when the network is "up" or "down", but i haven't looked at how it actually works in practice. my desktop environment is a bit of a chimera made of bits and parts of multiple things, so it's probably not standard at all.. normally, i guess there would eb a network target, which I depend on in so i need to test that bit.. my workstation is always online, so i haven't had that scenario yet, but i'll be testing on the laptop soon and report back here. in any case, i'll work on a quick howto for the readme when i figured out the whole universe. ;) |
|
so just for the record... i just stumbled upon a case where i ran then i felt "oh noes, it won't restart again because systemd will think it's dead, dang it!" but by default, systemd retries, and it did just that cleanly a faithful 2 minutes later: ... well, more or less two minutes. there are probably ways to tweak retry times and so on - i haven't looked. and i haven't looked at network issues yet. here ssh and ntpd and things get reloaded when wifi is cycled on suspend/resume, but i am not sure those are systemd hooks as much as NetworkManager calling systemd directly. so still investigating, but so far so good: things generally work. |
|
after a chat with people in now as for actually hooking in "network up" events, that is network-manager-dependent according to my research. that means basically writing a DBUS daemon, which is far from worth it, in my opinion. :) |
|
Update: here's my current configuration. I am using I've also created the |
|
Could you please make a PR? I'm happy to merge it. |
|
what should the PR look like? patch to the README? |
|
I think you could put a |
|
alright done, see #12. i added it in the "howto" section, as it seemed to fit more naturally there, but maybe I'm mistaken? |
So I've looked at how to run SMD in a more standard way. I originally setup
smd-loopand ran that in a terminal, but it seemed annoying to have to start that in each session. I considered using the applet, but I don't really need to have that stuff cluttering my desktop and i don't have a standard GNOME/whatever desktop environment.So I turned towards systemd: it already runs other stuff in my user session and it's designed to handle processes like these.
My first attempt was to start smd-loop, and that worked fairly well. It's pretty simple, just drop this in
~/.config/systemd/user/smd-loop.service:... and then enable and start the thing:
The output of
smd-loopis visible throughsystemctl --user status smd-loopand also of course its own usual logfile.But then I thought: what does
smd-loopdo really... I don't really need it! It can be reimplemented with systemd services and timers! So you need this service for pull, in~/.config/systemd/user/smd-pull.service:And you need a timer file as well, in
~/.config/systemd/user/smd-pull.timer:The above sets up a pull every 2 minutes. Configure to your wishes. Then you enable the whole thing:
To start the "service", you can use:
Obviously, you can still run
smd-pullby hand, but the above keeps the log in systemd.statusalso does the right thing:Rinse and repeat for
smd-push.So there you go. I'm not sure how to integrate this directly in SMD, but it sure is neat here. ;) How should I proceed? docs (
README)? or the files inmisc/? orsystemd/?The text was updated successfully, but these errors were encountered: