Skip to content

Commit

Permalink
Testing building with bash-completion and systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Sep 3, 2024
1 parent bf46485 commit 166c9d7
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion pkg/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DH_VERBOSE = 1
.PHONY: override_dh_strip

%:
dh $@
dh $@ --with python3,bash-completion --with=systemd

# dh_auto_clean tries to invoke distutils causing failures.
override_dh_auto_clean:
Expand Down
42 changes: 21 additions & 21 deletions pkg/debian/salt-api.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ case "$1" in
fi
chown $RET:$RET /var/log/salt/api
fi
if command -v systemctl; then
db_get salt-api/active
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-api
fi
db_get salt-api/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-api
else
systemctl enable salt-api
fi
else
systemctl daemon-reload
systemctl restart salt-api
systemctl enable salt-api
fi
fi
## DGM if command -v systemctl; then
## DGM db_get salt-api/active
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" != 10 ]; then
## DGM systemctl daemon-reload
## DGM if [ "$RESLT" = "active" ]; then
## DGM systemctl restart salt-api
## DGM fi
## DGM db_get salt-api/enabled
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" = "disabled" ]; then
## DGM systemctl disable salt-api
## DGM else
## DGM systemctl enable salt-api
## DGM fi
## DGM else
## DGM systemctl daemon-reload
## DGM systemctl restart salt-api
## DGM systemctl enable salt-api
## DGM fi
## DGM fi
;;
esac
18 changes: 9 additions & 9 deletions pkg/debian/salt-api.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ case "$1" in
CUR_GROUP=$(ls -dl /run/salt-api.pid | cut -d ' ' -f 4)
db_set salt-api/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /var/log/salt/api
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-api | cut -d '=' -f 2)
db_set salt-api/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-api)
db_set salt-api/active $SM_ACTIVE
else
db_set salt-api/enabled enabled
db_set salt-api/active active
## DGM if command -v systemctl; then
## DGM SM_ENABLED=$(systemctl show -p UnitFileState salt-api | cut -d '=' -f 2)
## DGM db_set salt-api/enabled $SM_ENABLED
## DGM SM_ACTIVE=$(systemctl is-active salt-api)
## DGM db_set salt-api/active $SM_ACTIVE
## DGM else
## DGM db_set salt-api/enabled enabled
## DGM db_set salt-api/active active

fi
## DGM fi
;;
esac
42 changes: 21 additions & 21 deletions pkg/debian/salt-master.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ case "$1" in
fi
chown -R $RET:$RET /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
fi
if command -v systemctl; then
db_get salt-master/active
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-master
fi
db_get salt-master/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-master
else
systemctl enable salt-master
fi
else
systemctl daemon-reload
systemctl restart salt-master
systemctl enable salt-master
fi
fi
## DGM if command -v systemctl; then
## DGM db_get salt-master/active
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" != 10 ]; then
## DGM systemctl daemon-reload
## DGM if [ "$RESLT" = "active" ]; then
## DGM systemctl restart salt-master
## DGM fi
## DGM db_get salt-master/enabled
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" = "disabled" ]; then
## DGM systemctl disable salt-master
## DGM else
## DGM systemctl enable salt-master
## DGM fi
## DGM else
## DGM systemctl daemon-reload
## DGM systemctl restart salt-master
## DGM systemctl enable salt-master
## DGM fi
## DGM fi
;;
esac
20 changes: 10 additions & 10 deletions pkg/debian/salt-master.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ case "$1" in
db_set salt-master/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master \
/var/log/salt/key /var/cache/salt/master /var/run/salt/master
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-master | cut -d '=' -f 2)
db_set salt-master/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-master)
db_set salt-master/active $SM_ACTIVE
else
db_set salt-master/enabled enabled
db_set salt-master/active active

fi
## DGM if command -v systemctl; then
## DGM SM_ENABLED=$(systemctl show -p UnitFileState salt-master | cut -d '=' -f 2)
## DGM db_set salt-master/enabled $SM_ENABLED
## DGM SM_ACTIVE=$(systemctl is-active salt-master)
## DGM db_set salt-master/active $SM_ACTIVE
## DGM else
## DGM db_set salt-master/enabled enabled
## DGM db_set salt-master/active active

## DGM fi
;;
esac

Expand Down
42 changes: 21 additions & 21 deletions pkg/debian/salt-minion.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ case "$1" in
fi
chown -R $RET:$RET /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion /var/cache/salt/minion /var/run/salt/minion
fi
if command -v systemctl; then
db_get salt-minion/active
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-minion
fi
db_get salt-minion/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-minion
else
systemctl enable salt-minion
fi
else
systemctl daemon-reload
systemctl restart salt-minion
systemctl enable salt-minion
fi
fi
## DGM if command -v systemctl; then
## DGM db_get salt-minion/active
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" != 10 ]; then
## DGM systemctl daemon-reload
## DGM if [ "$RESLT" = "active" ]; then
## DGM systemctl restart salt-minion
## DGM fi
## DGM db_get salt-minion/enabled
## DGM RESLT=$(echo "$RET" | cut -d ' ' -f 1)
## DGM if [ "$RESLT" = "disabled" ]; then
## DGM systemctl disable salt-minion
## DGM else
## DGM systemctl enable salt-minion
## DGM fi
## DGM else
## DGM systemctl daemon-reload
## DGM systemctl restart salt-minion
## DGM systemctl enable salt-minion
## DGM fi
## DGM fi
;;
esac
18 changes: 9 additions & 9 deletions pkg/debian/salt-minion.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ case "$1" in
db_set salt-minion/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion \
/var/cache/salt/minion /var/run/salt/minion
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-minion | cut -d '=' -f 2)
db_set salt-minion/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-minion)
db_set salt-minion/active $SM_ACTIVE
else
db_set salt-minion/enabled enabled
db_set salt-minion/active active
## DGM if command -v systemctl; then
## DGM SM_ENABLED=$(systemctl show -p UnitFileState salt-minion | cut -d '=' -f 2)
## DGM db_set salt-minion/enabled $SM_ENABLED
## DGM SM_ACTIVE=$(systemctl is-active salt-minion)
## DGM db_set salt-minion/active $SM_ACTIVE
## DGM else
## DGM db_set salt-minion/enabled enabled
## DGM db_set salt-minion/active active

fi
## DGM fi
;;
esac

0 comments on commit 166c9d7

Please sign in to comment.