No description
Find a file
2023-01-25 09:26:00 +01:00
_man Make check updates more generic, fix failure notify requirements and update docs 2023-01-25 09:26:00 +01:00
_pkg Rename to system-helpers 2022-09-17 20:28:53 +02:00
etc Rename to system-helpers 2022-09-17 20:28:53 +02:00
usr Make check updates more generic, fix failure notify requirements and update docs 2023-01-25 09:26:00 +01:00
.drone.yml ArchLinux repository without any $arch 2022-07-11 22:49:31 +02:00
README.md Make check updates more generic, fix failure notify requirements and update docs 2023-01-25 09:26:00 +01:00
system-helpers-sync Rename to system-helpers 2022-09-17 20:28:53 +02:00

README

system-helpers - Collection of helper systemd services, systemd timers and shell scripts for common configuration.

system-helpers collection provides the following helpers

  • checking if systemd services and timers are running (see man systemd_check)
  • borgmatic backup (see exposed systemd services borgmatic@ which require a valid borgmatic.yml file in /etc/borgmatic or your $HOME/.config/borgmatic)
  • restic backup (see /usr/share/doc/system-helpers/restic for an example mybackup)
  • checking if docker containers are running (see man docker_check)
  • batch docker-compose upgrades (see man docker_compose_update)
  • dynamic dns update (see man docker_compose_update)
  • memory and disk checks (see man disk_space_alert and man memory_usage_alert)
  • docker housekeeping for removing unused docker containers, volumes and images
  • update check for pacman (ArchLinux specific, see man check_updates)

Provided systemd services mostly support mail notifications if they have failed via systemd_failure_notify.

See /usr/share/doc/system-helpers for example configurations which should be copied inside $HOME or /etc depending on the helper script.

Installation

Package manager for Arch Linux

  1. Build a pacman package for ArchLinux via makepkg -csi inside the _pkg/ folder
  2. Alternatively, use ./sync from the git clone and pick an action which should be self-explaining
  3. Use the custom provided ArchLinux repository hosted at aur.myservermanager.com
[repo-aur-myservermanager-com]
SigLevel = Never
Server = https://aur.myservermanager.com

system-helpers-sync script to synchronize files to locations

  1. Clone this repository
  2. Run ./system-helpers-sync and use the option you like to use

Usage

Services and scripts don't depend on each other but have hints that they can be combined (out-commented line in service files for systemd_failure_notify@.service for example).

Examples are given inside usr/share/doc/system-helpers.

FAQ

User cannot use network-online.target

By default, no user unit can depend on system events like network-online.target. To enable this, you need to link the proper .target which you like to use inside the user service before.

systemctl --user link /usr/lib/systemd/system/network-online.target

This would make network-online.target available after a reboot to the user who issued the command.

network-online.target doesn't recognize DNS correctly

If you like to set Persistent=true, then you should probably equip the related .service file with a ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' or any domain you think is 100% reachable.