Skip to content

Commit

Permalink
Update shudown detection
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Dec 18, 2024
1 parent 97c6d85 commit 02e88d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions zram-config
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ serviceConfiguration() {
else
if [[ $(systemctl is-active rsyslog.service) == "active" ]]; then
export rsyslogActive="true"
if ! systemctl --no-block stop syslog.socket; then
if ! systemctl stop syslog.socket; then
log "ERROR" "Failed to stop syslog service."
return 1
fi
Expand All @@ -290,7 +290,7 @@ serviceConfiguration() {
log "ERROR" "Failed to flush journal."
return 1
fi
if ! systemctl --no-block stop systemd-journald.socket systemd-journald-audit.socket systemd-journald-dev-log.socket; then
if ! systemctl stop systemd-journald.socket systemd-journald-audit.socket systemd-journald-dev-log.socket; then
log "ERROR" "Failed to stop journald service."
return 1
fi
Expand Down Expand Up @@ -323,9 +323,8 @@ TMPDIR="/usr/local/lib/zram-config"
ZDIR="/opt/zram"
ZLOG="/usr/local/share/zram-config/log/zram-config.log"
OS="$(grep -o '^ID=.*$' /etc/os-release | cut -d'=' -f2)"
RUNLEVEL="$(runlevel | cut -d' ' -f2)"
if [[ $RUNLEVEL == "1" ]] || [[ $RUNLEVEL == "6" ]]; then
SHUTDOWN="1"
if systemctl list-jobs | grep -q 'shutdown.target.*start' || systemctl list-jobs | grep -q 'reboot.target.*start'; then
SHUTDOWN=1
fi

case "$1" in
Expand Down

0 comments on commit 02e88d0

Please sign in to comment.