diff --git a/Makefile b/Makefile index da4b511..3deebc9 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ install: install -d $(DESTDIR)/$(PREFIX)/usr/sbin install -m0755 ./nohang $(DESTDIR)/$(PREFIX)/usr/sbin/nohang - install -d $(DESTDIR)/$(PREFIX)/usr/sbin - install -m0755 ./nohang_notify_low_mem $(DESTDIR)/$(PREFIX)/usr/sbin/nohang_notify_low_mem + install -d $(DESTDIR)/$(PREFIX)/usr/bin + install -m0755 ./nohang_notify_low_mem $(DESTDIR)/$(PREFIX)/usr/bin/nohang_notify_low_mem install -d $(DESTDIR)/$(PREFIX)/usr/bin install -m0755 ./oom-sort $(DESTDIR)/$(PREFIX)/usr/bin/oom-sort @@ -31,8 +31,9 @@ uninstall: # 'make uninstall' must not fail with error if systemctl is unavailable or returns error systemctl disable nohang.service || true rm -fv $(PREFIX)/usr/sbin/nohang - rm -fv $(PREFIX)/usr/sbin/nohang_notify_low_mem + rm -fv $(PREFIX)/usr/bin/nohang_notify_low_mem rm -fv $(PREFIX)/usr/bin/oom-sort + rm -fv $(PREFIX)/usr/bin/oom-trigger rm -fv $(PREFIX)/usr/share/man/man1/nohang.1.gz rm -fv $(PREFIX)/usr/share/man/man1/oom-sort.1.gz rm -fv $(PREFIX)/usr/share/man/man1/oom-trigger.1.gz diff --git a/nohang b/nohang index ca58b38..a26c32c 100755 --- a/nohang +++ b/nohang @@ -259,8 +259,12 @@ def send_notify_warn(): if root: # If nohang was started by root # send notification to all active users with special script - Popen(['/usr/sbin/nohang_notify_low_mem', '--mem', low_mem_percent, - '--pid', pid, '--name', name]) + Popen([ + '/usr/bin/nohang_notify_low_mem', + '--mem', low_mem_percent, + '--pid', pid, + '--name', name + ]) else: # Or by regular user # send notification to user that runs this nohang Popen(['notify-send', '--icon=dialog-warning', '{}'.format(title), '{}'.format(body)]) @@ -687,6 +691,8 @@ uid_index = status_names.index('Uid') # directory where the script is running cd = os.getcwd() +print('CD:', cd) + # where to look for a config if not specified via the -c/--config option default_configs = (cd + '/nohang.conf', '/etc/nohang/nohang.conf') diff --git a/nohang_notify_low_mem b/nohang_notify_low_mem index 74f2eed..0ee1dba 100755 --- a/nohang_notify_low_mem +++ b/nohang_notify_low_mem @@ -92,4 +92,4 @@ if len(b) > 0: 'env', display_env, dbus_env, 'notify-send', '--icon=dialog-warning', '{}'.format(title), '{}'.format(body)] - ).wait(1) + )