This commit is contained in:
@@ -21,8 +21,6 @@ test/GitSafetySpec.hs # Operation-in-progress detection tests
|
||||
SPEC.md # Human-readable specifications
|
||||
converge.example.yaml # Example config file
|
||||
converge.service # systemd user service (daemon mode)
|
||||
converge-wake.service # systemd user service (wake-from-sleep sync)
|
||||
src/system-sleep/ # systemd-sleep hook scripts
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -15,13 +15,11 @@ optdepends=('converge-relay: realtime push notifications via SSE relay server')
|
||||
backup=('etc/converge/config.example.yaml')
|
||||
source=(
|
||||
"converge.service"
|
||||
"converge-wake.service"
|
||||
"converge.example.yaml"
|
||||
)
|
||||
md5sums=(
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
)
|
||||
|
||||
build() {
|
||||
@@ -59,12 +57,6 @@ package() {
|
||||
# User systemd services
|
||||
install -Dm644 converge.service \
|
||||
"$pkgdir/usr/lib/systemd/user/converge.service"
|
||||
install -Dm644 converge-wake.service \
|
||||
"$pkgdir/usr/lib/systemd/user/converge-wake.service"
|
||||
|
||||
# Sleep hook (runs converge --sync for all logged-in users after resume)
|
||||
install -Dm755 src/system-sleep/converge-wake \
|
||||
"$pkgdir/usr/lib/systemd/system-sleep/converge-wake"
|
||||
|
||||
# Example config
|
||||
install -Dm644 converge.example.yaml \
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
## Supports logging to a file instead of stderr via --log-file or log_file config
|
||||
## Can notify on pull: per-repo notify_on_pull setting sends a desktop notification when new commits are pulled from the remote
|
||||
|
||||
## --sync / -s flag runs a single sync cycle (commit + pull + push) and exits, useful for wake-from-sleep hooks
|
||||
## --sync / -s flag runs a single sync cycle (commit + pull + push) and exits
|
||||
|
||||
## Can connect to a converge-relay SSE endpoint and automatically pull when push events arrive
|
||||
### Configured via --relay-url CLI flag or relay_url config file entry
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
[Unit]
|
||||
Description=Converge - sync repos after waking from sleep
|
||||
Documentation=https://github.com/jbrechtel/converge
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/converge --sync
|
||||
# Small delay as a safety net for environments (e.g. netctl) where
|
||||
# network-online.target may not gate properly on resume, giving the
|
||||
# network stack time to reconnect before converge attempts to pull.
|
||||
ExecStartPre=/bin/sleep 5
|
||||
|
||||
# Allow notify-send to reach the desktop session
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Hook for systemd-sleep: run converge --sync for each logged-in user after resume.
|
||||
# Installed to /usr/lib/systemd/system-sleep/converge-wake.
|
||||
# Called with $1 = "pre" (before sleep) or "post" (after resume).
|
||||
|
||||
if [ "$1" = "post" ]; then
|
||||
# The converge-wake.service has After=network-online.target, so systemd
|
||||
# won't run the actual sync until the network stack is restored. This
|
||||
# hook only needs to request the start.
|
||||
loginctl list-users --no-legend 2>/dev/null | while read uid name rest; do
|
||||
[ "$uid" -ge 1000 ] 2>/dev/null || continue
|
||||
su "$name" -c "XDG_RUNTIME_DIR=/run/user/$uid systemctl --user --no-block start converge-wake.service" 2>/dev/null || true
|
||||
done
|
||||
fi
|
||||
Reference in New Issue
Block a user