A common and reliable pattern in service unit files is thus:
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
| #!/usr/bin/env bash | |
| set -e | |
| # This is a simple mirroring script. To save bandwidth it first checks a | |
| # timestamp via HTTP and only runs rsync when the timestamp differs from the | |
| # local copy. As of 2016, a single rsync run without changes transfers roughly | |
| # 6MiB of data which adds up to roughly 250GiB of traffic per month when rsync | |
| # is run every minute. Performing a simple check via HTTP first can thus save a | |
| # lot of traffic. |
| #!/usr/bin/env bash | |
| while :; do | |
| bash loop | |
| sleep 5 | |
| done |
| #!/bin/bash | |
| # Usage ./gpumeter.sh my-gpu-hungry-script.sh | |
| # Check if the command argument is provided | |
| if [ "$#" -ne 1 ]; then | |
| echo "Usage: $0 <script_to_run>" | |
| exit 1 | |
| fi |