From: Ian Kelling Date: Tue, 1 Dec 2020 22:25:08 +0000 (-0500) Subject: fixes and improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=e2bbeecbce92b88cb1505db410517b7b5e724409;p=distro-setup fixes and improvements --- diff --git a/distro-end b/distro-end index 0e34b6e..615f98a 100755 --- a/distro-end +++ b/distro-end @@ -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' diff --git a/filesystem/etc/systemd/logind.conf.d/iank.conf b/filesystem/etc/systemd/logind.conf.d/iank.conf index dc58951..0ddbf9f 100644 --- a/filesystem/etc/systemd/logind.conf.d/iank.conf +++ b/filesystem/etc/systemd/logind.conf.d/iank.conf @@ -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% diff --git a/mail-setup b/mail-setup index 8ae33ba..23c4c0d 100755 --- a/mail-setup +++ b/mail-setup @@ -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 < >(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 diff --git a/mount-latest-subvol b/mount-latest-subvol index e3496d5..77ade00 100644 --- a/mount-latest-subvol +++ b/mount-latest-subvol @@ -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 d6a3674..836185e 100644 --- a/pkgs +++ b/pkgs @@ -171,6 +171,7 @@ p3=( pidgin pidgin-otr pixz + profile-sync-daemon pry pv python-autopep8 diff --git a/primary-setup b/primary-setup index 4011838..08ee7a5 100755 --- a/primary-setup +++ b/primary-setup @@ -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 index 0000000..92af105 --- /dev/null +++ b/subdir_files/.config/psd/psd.conf @@ -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