Improve systemd services: automatic restart

This commit is contained in:
Thomas Dehaeze 2019-05-02 10:44:57 +02:00
parent c3408232b8
commit 0b1247d8bc

View File

@ -29,6 +29,7 @@
Description=Sync All Mails every x hours
RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
After=network.target network-online.target dbus.socket
[Timer]
@ -88,6 +89,7 @@
Description=Check Mail every x minutes
RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
After=network.target network-online.target dbus.socket
Requires=checkmail.service
@ -188,6 +190,7 @@
Description=Sync All Mails every x hours
RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
After=network.target network-online.target dbus.socket
Requires=syncmail.service
@ -235,6 +238,8 @@
[Unit]
Description=Synchronize calendars and contacts
Documentation=https://vdirsyncer.readthedocs.org/
Wants=network-online.target
After=network.target network-online.target
[Service]
ExecStart=/usr/bin/vdirsyncer sync
@ -246,7 +251,6 @@
:header-args: :tangle ~/.config/systemd/user/vdirsyncer.timer
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Synchronize vdirs
@ -268,13 +272,53 @@
#+begin_src conf
[Unit]
Description=A WeeChat client and relay service using Tmux
After=network.target
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=forking
ExecStart=/usr/bin/tmux -L weechat new -d -s weechat weechat
ExecStop=/usr/bin/tmux -L weechat kill-session -t weechat
Restart=always
RestartSec=3
[Install]
WantedBy=default.target
#+end_src
* Neomutt
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/neomutt.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Neomutt - mail client
[Service]
Type=forking
ExecStart=/usr/bin/tmux -L neomutt new -d -s neomutt neomutt
ExecStop=/usr/bin/tmux -L neomutt kill-session -t neomutt
Restart=always
RestartSec=3
[Install]
WantedBy=default.target
#+end_src
* Powertop
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/powertop.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Powertop tunings
[Service]
ExecStart=/usr/bin/powertop --auto-tune
RemainAfterExit=true
[Install]
WantedBy=multi-user.target
#+end_src