X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=conflink;h=defb8321d87e1fef55112a6c11e8f28f8e7ff52e;hb=5b09fb8ae01ae1c9aa5c3ccde60f6e6a22f7d6a6;hp=d7323fdf0e9d1ee29ff4c3cf8e8d035cf752aacd;hpb=b18dade73dedfe69aa741f8417947d83c4208f2d;p=distro-setup diff --git a/conflink b/conflink index d7323fd..defb832 100755 --- a/conflink +++ b/conflink @@ -81,7 +81,10 @@ common-file-setup() { for dir in "$@"; do fs=$dir/filesystem if [[ -e $fs && $user =~ ^iank?$ ]]; then - cmd=( s rsync -aiSAX --chown=root:root --chmod=g-s + # we dont want t, instead c for checksum. + # That way we dont set times on directories. + # -a = -rlptgoD + cmd=( s rsync -rclpgoDiSAX --chown=root:root --chmod=g-s --exclude=/etc/dovecot/users --exclude='/etc/exim4/passwd*' --exclude='/etc/exim4/*.pem' @@ -90,6 +93,15 @@ common-file-setup() { while read -r line; do file="${line:12}" case $file in + etc/prometheus/rules/iank.yml) + case $HOSTNAME in + kd) + if systemctl is-active prometheus &>/dev/null; then + m s systemctl reload prometheus + fi + ;; + esac + ;; etc/systemd/system/*) reload_systemd=true ;; @@ -110,7 +122,7 @@ common-file-setup() { done < <("${cmd[@]}") fi - if [[ -e $dir/subdir_files ]]; then + if ! $fast && [[ -e $dir/subdir_files ]]; then m subdir-link-r $dir/subdir_files fi local x=( $dir/!(binds|subdir_files|filesystem|machine_specific|..|.|.#*) ) @@ -180,7 +192,7 @@ case $user in for f in /etc/prometheus-{,export-}htpasswd; do if [[ -e $f ]]; then s chmod 640 $f - if getent passwd www-data; then + if getent passwd www-data &>/dev/null; then s chown root:www-data $f fi fi @@ -189,15 +201,15 @@ case $user in if [[ -e $f ]]; then # note: this is duplicative of the file's own permissions s chmod 640 $f /etc/prometheus-pass - if getent passwd prometheus; then + if getent passwd prometheus &>/dev/null; then s chown root:prometheus $f fi fi - - ##### end special extra stuff ##### - m sudo -H -u user2 "${BASH_SOURCE[0]}" + if ! $fast; then + m sudo -H -u user2 "${BASH_SOURCE[0]}" + fi f=/a/bin/distro-setup/system-status if [[ -x $f ]]; then