fixes and improvements
authorIan Kelling <ian@iankelling.org>
Tue, 1 Dec 2020 22:25:08 +0000 (17:25 -0500)
committerIan Kelling <ian@iankelling.org>
Tue, 1 Dec 2020 22:29:53 +0000 (17:29 -0500)
distro-end
filesystem/etc/systemd/logind.conf.d/iank.conf
mail-setup
mount-latest-subvol
pkgs
primary-setup
subdir_files/.config/psd/psd.conf [new file with mode: 0644]

index 0e34b6ed8e2126cf03a205ea20b3875e1965f640..615f98aef6ee9a562e361932df604a91aef00439 100755 (executable)
@@ -344,6 +344,14 @@ Package: spamassassin sa-compile spamc
 Pin: release n=focal,o=Ubuntu
 Pin-Priority: 500
 EOF
+    sd /etc/apt/preferences.d/psd <<'EOF'
+Package: profile-sync-daemon
+Pin: release n=focal,o=Ubuntu
+Pin-Priority: 500
+EOF
+    seru enable psd
+    seru sart psd
+
     f=/etc/apt/sources.list.d/focal.list
     t=$(mktemp)
     cat >$t <<'EOF'
index dc58951e769aa7b6154a83e6a882fd37fab38f02..0ddbf9f444a5c74b9426749ea96d01d62813f089 100644 (file)
@@ -1,3 +1,6 @@
 # See logind.conf(5) for details.
 [Login]
 HandleLidSwitch=ignore
+# seems like a good idea.
+# https://wiki.archlinux.org/index.php/profile-sync-daemon#I_need_more_memory_to_accommodate_my_profile/profiles_in_/run/user/xxxx._How_can_I_allocate_more?
+RuntimeDirectorySize=50%
index 8ae33ba3ff0a9f1f052ef9b49c8ff7fb3cde0df1..23c4c0def8029e77b171c7c0ebf051221701a0e3 100755 (executable)
@@ -3,9 +3,11 @@
 # Copyright (C) 2019 Ian Kelling
 # SPDX-License-Identifier: AGPL-3.0-or-later
 
-# todo: notification of updates for nextcloud.
-# this should do it:
-# if ! timeout 10 sudo -u www-data php /var/www/ncninja/updater/updater.phar
+# todo, primary-setup doesnt get called on distro-begin
+# todo: sm pull really needs to execute as systemd else it will always fail
+# because of journal reload
+#
+# todo: bbk -t kw didn't remount /p to a new subvol
 
 # todo setup better backup/sync of MAIL_HOST emails
 
@@ -1740,7 +1742,7 @@ EOF
     fi
     m cd $ncdir/config
     if [[ ! -e config.php-orig ]]; then
-      m cp config.php config.php-orig
+      m cp -a config.php config.php-orig
     fi
     cat config.php-orig - >tmp.php <<EOF
 # https://docs.nextcloud.com/server/19/admin_manual/configuration_server/email_configuration.html
@@ -1783,9 +1785,12 @@ EOF
         m sudo -u www-data php $ncdir/occ app:install $app
       fi
     done
-    # https://docs.nextcloud.com/server/19/admin_manual/configuration_server/background_jobs_configuration.html
     i /etc/cron.d/$ncbase <<'EOF'
-*/5  *  *  *  * php -f $ncdir/cron.php --define apc.enable_cli=1
+SHELL=/bin/bash
+# automatic update. https://stackoverflow.com/questions/26915448/how-do-i-copy-stderr-without-stopping-it-writing-to-the-terminal
+0  9  *  *  * www-data php { $ncdir/updater/updater.phar -n 2> >(tee >(cat 1>&2)) || echo fail >&2; } | systemd-cat -t ncupdate
+# https://docs.nextcloud.com/server/19/admin_manual/configuration_server/background_jobs_configuration.html
+*/5  *  *  *  * php -f $ncdir/cron.php --define apc.enable_cli=1 |& log-once nccron
 EOF
 
   done
index e3496d581218cbe679ddcbe858dd38dd29997a04..77ade005af8620cb7e6a5999aed80de0affeed5c 100644 (file)
@@ -201,7 +201,6 @@ while [[ ${my_pids[-1]} != 1 && ${my_pids[-1]} != ${my_pids[-2]} && $count -lt $
   my_pids+=($p)
 done
 
-
 for vol in q a o i; do
   d=/$vol
   if ! awk '{print $2}' /etc/fstab | grep -xF $d &>/dev/null; then
@@ -219,7 +218,7 @@ for vol in q a o i; do
       # eg. when r=/q/p, for lines like
       # /q/p  /p  none  bind  0 0
       # output /p
-      new_roots+=($(sed -rn "s#^$r/\S+\s+(\S+)\s+none\s+bind\s.*#\1#p" /etc/fstab))
+      new_roots+=($(sed -rn "s#^$r/\S+\s+(\S+)\s+none\s+(\S+,|)bind[[:space:],].*#\1#p" /etc/fstab))
     done
     (( ${#new_roots} )) || break
     binds+=(${new_roots[@]})
@@ -308,7 +307,12 @@ for vol in q a o i; do
                     grep -vxF "Found a valid Btrfs stream header, version 1" | \
                     grep -cv "^[^;]*;snapshot: ") ||:
           if [[ $lines == 0 ]]; then
-            x btrfs sub del $leaf
+            # the snapshot diff is broken, it deleted a snapshot that was different.
+            # I need some examples to test on.
+            # also, why are we ignoring the error code in the snapshot diff,
+            # seems like we shouldnt do that
+            echo suspected identical: $bsub $leaf
+            #x btrfs sub del $leaf
           fi
         fi
       fi
diff --git a/pkgs b/pkgs
index d6a36740c27645d92030dd6dca3bbf315c8f6db7..836185e1ddd606ad95e081c771c4a9cb4a279b67 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -171,6 +171,7 @@ p3=(
   pidgin
   pidgin-otr
   pixz
+  profile-sync-daemon
   pry
   pv
   python-autopep8
index 4011838a59a89727ae41e56374ce70dceed761ee..08ee7a506da547d7b35d60572ee9f7ea6e9b4898 100755 (executable)
@@ -49,22 +49,22 @@ if dpkg -s rss2email &>/dev/null; then
   fi
 fi
 
-if dpkg -s radicale &>/dev/null; then
-  if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
-    m sudo systemctl restart radicale
-    m sudo systemctl enable radicale
-    if [[ -e /etc/logrotate.d/radicale.disabled ]]; then
-      m sudo mv /etc/logrotate.d/radicale{.disabled,}
-    fi
-  else
-    m sudo systemctl stop radicale
-    m sudo systemctl disable radicale
-    # weekly logrotate tries to restart radicale even if it's a disabled service in flidas.
-    if [[ -e /etc/logrotate.d/radicale ]]; then
-      m sudo mv /etc/logrotate.d/radicale{,.disabled}
-    fi
-  fi
-fi
+if dpkg -s radicale &>/dev/null; then
+  if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
+    m sudo systemctl restart radicale
+    m sudo systemctl enable radicale
+    if [[ -e /etc/logrotate.d/radicale.disabled ]]; then
+      m sudo mv /etc/logrotate.d/radicale{.disabled,}
+    fi
+  else
+    m sudo systemctl stop radicale
+    m sudo systemctl disable radicale
+    # weekly logrotate tries to restart radicale even if it's a disabled service in flidas.
+    if [[ -e /etc/logrotate.d/radicale ]]; then
+      m sudo mv /etc/logrotate.d/radicale{,.disabled}
+    fi
+  fi
+fi
 
 if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
   m sudo systemctl start openvpn-client@hole
@@ -76,4 +76,3 @@ fi
 
 m /a/exe/mail-setup
 exit 0
-:
diff --git a/subdir_files/.config/psd/psd.conf b/subdir_files/.config/psd/psd.conf
new file mode 100644 (file)
index 0000000..92af105
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# $XDG_HOME_CONFIG/psd/psd.conf
+#
+# For documentation, refer to the psd man page or the wiki page
+# https://wiki.archlinux.org/index.php/Profile-sync-daemon
+
+## NOTE the following:
+## To protect data from corruption, in the event that you do make an edit while
+## psd is active, any changes made will be applied the next time you start psd.
+
+# Uncomment and set to "yes" to use overlayfs instead of a full copy to reduce
+# the memory costs and to improve sync/unsync operations. Note that your kernel
+# MUST have this module available in order to use this mode
+#
+USE_OVERLAYFS="yes"
+
+# List browsers separated by spaces to include in the sync. Useful if you do not
+# wish to have all possible browser profiles sync'ed which is the default if
+# this variable is left commented.
+#
+# Possible values:
+#  chromium
+#  chromium-dev
+#  conkeror.mozdev.org
+#  epiphany
+#  falkon
+#  firefox
+#  firefox-trunk
+#  google-chrome
+#  google-chrome-beta
+#  google-chrome-unstable
+#  heftig-aurora
+#  icecat
+#  inox
+#  luakit
+#  midori
+#  opera
+#  opera-beta
+#  opera-developer
+#  opera-legacy
+#  otter-browser
+#  qupzilla
+#  qutebrowser
+#  palemoon
+#  rekonq
+#  seamonkey
+#  surf
+#  vivaldi
+#  vivaldi-snapshot
+#
+BROWSERS="firefox"
+
+# Uncomment and set to "no" to completely disable the crash recovery feature.
+#
+# The default is to create crash recovery backups if the system is ungracefully
+# powered-down due to a kernel panic, hitting the reset switch, battery going
+# dead, etc. Some users keep very diligent backups and don't care to have this
+# feature enabled.
+USE_BACKUPS="no"
+
+# Uncomment and set to an integer that is the maximum number of crash recovery
+# snapshots to keep (the oldest ones are delete first).
+#
+# The default is to save the most recent 5 crash recovery snapshots.
+#BACKUP_LIMIT=5