tmpstr=$(jobs 2>/dev/null)
mapfile -t jobs_out <<<"$tmpstr"
found_job=false
- regex="^[^[:space:]]+[[:space:]]+Running[[:space:]]+ journalctl --since=now -qn2 -f -u $service &"
+ regex="^[^[:space:]]+[[:space:]]+Running[[:space:]]+journalctl --since=now -qn2 -f -u $service &"
for line in "${jobs_out[@]}"; do
if [[ $line =~ $regex ]]; then
found_job=true
done
if ! $found_job; then
- journalctl --since=now -qn2 -f -u "$service" &
+ # without eval, jobs output will include literal "$service". We
+ # could match that, but then we can run serj on different services
+ # in the same terminal.
+ eval "journalctl --since=now -qn2 -f -u $service &"
sleep 3
fi
if [[ $EUID == 0 ]]; then
esac
done
n=$1
- shift
- codename=$1
- shift
+ codename=$2
+ shift 2
case $codename in
aramo|ecne|nabia|etiona)
;;
esac
- if ! $force && schroot -l | grep -xFq chroot:$n; then
- echo "$0: $n schroot already installed, skipping"
- return 0
+ if ! $force; then
+ if schroot -l | grep -xFq chroot:$n || [[ -s /etc/schroot/chroot.d/$n.conf ]]; then
+ echo "$0: $n schroot already exists, skipping"
+ return 0
+ fi
fi
apps=($@)
if [[ ! $d ]]; then
chro-pull() {
local pull_host="$1"
scp -ra --delete iank@$pull_host:.config/chromium /home/iank/.config
- }
+}
export BASEFILE_DIR=/a/bin/fai-basefiles
$d_host)
# to persist upload/dl metadata. initially, moved all the stuff
# in /var/lib/transmission-daemon to /d/tor
- s usermod --home /d/tor debian-transmission
+
+ transmission_home=$(eval echo ~debian-transmission)
+ if [[ $transmission_home != /d/tor ]]; then
+ if ser is-active transmission-daemon-nn &>/dev/null; then
+ ser stop transmission-daemon-nn
+ fi
+ s usermod --home /d/tor debian-transmission
+ fi
sgo transmission-daemon-nn
;;
*)
fi
d=$f/.config/transmission-remote-gtk
sudo -u $u mkdir -p $d
+ d_host_suffix=$(awk '$2 == "'$d_host'" {print $1}' /p/c/host-info)
# i tried setting hostname to transmission.b8.nz, so i could dynamically change where
# this connects to, but it said some 421 denied error when I did that. Then it
# froze X when i ran it under strace. Whatever.
"profiles" : [
{
"profile-name" : "Default",
- "hostname" : "10.174.2.2",
+ "hostname" : "10.174.$d_host_suffix.2",
"rpc-url-path" : "/transmission/rpc",
"username" : "",
"password" : "$rpc_pass",
case $HOSTNAME in
$d_host)
# Font awesome is needed for the alertmanager ui.
- pi prometheus-alertmanager prometheus fonts-font-awesome
- /a/f/ans/roles/prom/files/simple/usr/local/bin/fsf-install-prometheus
+ pi prometheus-blackbox-exporter prometheus-alertmanager prometheus fonts-font-awesome
+ s /a/f/ans/roles/prom/files/simple/usr/local/bin/fsf-install-prometheus
# make it available for other machines
rsync -a /usr/local/bin/amtool /a/opt/bin
# Remove dep that came in with desktop to fix associations.
m pu transmission-gtk
-f=/home/iank/Videos
-case $HOSTNAME in
- $d_host)
- if [[ ! -L $f || $(readlink $f) != /d/vidshare ]]; then
- fs=($f/*)
- if (( ${#fs[@]} >= 1 )); then
- echo "$0: I wanted to make a link $f -> /d/vidshare, but $f is not empty. Please do something with its contents. ll $f:"
- ll $f
- exit 1
- fi
- lnf -T /d/vidshare $f
- fi
- ;;
- *)
- if [[ -L $f && $(readlink $f) == /d/vidshare ]]; then
- rm -f $f
- mkdir $f
- fi
- ;;
-esac
-
# # Based on guix manual instructions, also added code to profile.
# # disabled since i'm not using it now.
# pi nscd
[Service]
User=debian-transmission
-Type=notify
+# The default is broken due to apparmor it seems
+# https://github.com/transmission/transmission/issues/6991
+#Type=notify
+Type=simple
ExecStart=/usr/bin/transmission-daemon -f --log-error
ExecReload=/bin/kill -s HUP $MAINPID
-ExecStop=/bin/kill -s STOP $MAINPID
PrivateNetwork=true
Nice=19
BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/basic-nsswitch:/etc/resolved-nsswitch:norbind
+
+NoNewPrivileges=true
+MemoryDenyWriteExecute=true
+ProtectSystem=true
+PrivateTmp=true
+
[Install]
WantedBy=multi-user.target