aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2021-08-17 11:57:03 +1200
committerTom Ryder <tom@sanctum.geek.nz>2021-08-17 11:57:03 +1200
commitb92e4451d09e47e2d52ff4cfcf796b7f5143d964 (patch)
treea5280819dc6970c7d5eec21e7dd4eb26334cf42e
parentMerge branch 'release/v11.8.0-fix' into develop (diff)
downloaddotfiles-develop.tar.gz
dotfiles-develop.zip
Switch to newsboat-dtach system service methoddevelop
-rw-r--r--Makefile5
-rw-r--r--newsboat/systemd/user/newsboat.service11
-rw-r--r--newsboat/systemd/user/reload-newsboat.service11
-rw-r--r--newsboat/systemd/user/reload-newsboat.timer10
4 files changed, 13 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index fe20d2df..ca3fe473 100644
--- a/Makefile
+++ b/Makefile
@@ -502,9 +502,8 @@ install-newsboat: install-systemd
-command -v systemctl >/dev/null 2>&1 \
&& mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \
&& cp -p -- newsboat/systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \
- && systemctl --user daemon-reload \
- && systemctl --user start reload-newsboat.timer \
- && systemctl --user enable reload-newsboat.timer
+ && systemctl --user enable newsboat.service \
+ && systemctl --user start newsboat.service
install-mysql:
cp -p -- mysql/my.cnf $(HOME)/.my.cnf
diff --git a/newsboat/systemd/user/newsboat.service b/newsboat/systemd/user/newsboat.service
new file mode 100644
index 00000000..645843e6
--- /dev/null
+++ b/newsboat/systemd/user/newsboat.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Newsboat news reader
+OnFailure=notify-email@%n
+
+[Service]
+Environment=TERM=screen-256color
+ExecStart=/usr/bin/dtach -N %t/newsboat.socket /usr/bin/newsboat --log-file=%L/newsboat/%p.log --log-level=2
+Restart=always
+
+[Install]
+WantedBy=default.target
diff --git a/newsboat/systemd/user/reload-newsboat.service b/newsboat/systemd/user/reload-newsboat.service
deleted file mode 100644
index ce53c472..00000000
--- a/newsboat/systemd/user/reload-newsboat.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=fetch new Newsboat articles
-OnFailure=notify-email@%n
-ConditionPathExists=!%h/.local/share/newsboat/cache.db.lock
-
-[Service]
-Type=oneshot
-LogsDirectory=newsboat
-LogsDirectoryMode=0700
-ExecStart=newsboat --execute=reload --log-file=%L/newsboat/%p.log --log-level=2
-TimeoutStartSec=5m
diff --git a/newsboat/systemd/user/reload-newsboat.timer b/newsboat/systemd/user/reload-newsboat.timer
deleted file mode 100644
index c3c0cb00..00000000
--- a/newsboat/systemd/user/reload-newsboat.timer
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=fetch new Newsboat articles schedule
-
-[Timer]
-OnBootSec=10m
-OnUnitActiveSec=10m
-RandomizedDelaySec=2m
-
-[Install]
-WantedBy=timers.target