fix logging; pep8 validation; add forbid_negative_badness and log_dir options

This commit is contained in:
Alexey Avramov
2019-03-20 17:47:14 +09:00
parent db0eea2213
commit a6171e85b8
4 changed files with 232 additions and 152 deletions

View File

@@ -4,29 +4,27 @@ PREFIX = /
all:
@ echo "Nothing to compile. Use: make install, make uninstall, make systemd"
install:
install:
install -d $(DESTDIR)/$(PREFIX)/usr/sbin
install -m0755 ./nohang $(DESTDIR)/$(PREFIX)/usr/sbin/nohang
install -m0755 ./nohang_notify_helper $(DESTDIR)/$(PREFIX)/usr/sbin/nohang_notify_helper
install -d $(DESTDIR)/$(PREFIX)/usr/bin
install -m0755 ./oom-sort $(DESTDIR)/$(PREFIX)/usr/bin/oom-sort
install -m0755 ./oom-trigger $(DESTDIR)/$(PREFIX)/usr/bin/oom-trigger
install -d $(DESTDIR)/$(PREFIX)/etc/nohang
install -m0644 ./nohang.conf $(DESTDIR)/$(PREFIX)/etc/nohang/$(VERSION)
install -m0644 ./nohang.conf $(DESTDIR)/$(PREFIX)/etc/nohang/nohang.conf.default
install -d $(DESTDIR)/$(PREFIX)/var/log/nohang
install -d $(DESTDIR)/$(PREFIX)/usr/share/man/man1
gzip -k -c nohang.1 > $(DESTDIR)/$(PREFIX)/usr/share/man/man1/nohang.1.gz
gzip -k -c oom-sort.1 > $(DESTDIR)/$(PREFIX)/usr/share/man/man1/oom-sort.1.gz
gzip -k -c oom-trigger.1 > $(DESTDIR)/$(PREFIX)/usr/share/man/man1/oom-trigger.1.gz
install -d $(DESTDIR)/$(PREFIX)/lib/systemd/system
install -m0644 ./nohang.service $(DESTDIR)/$(PREFIX)/lib/systemd/system/nohang.service
uninstall:
# 'make uninstall' must not fail with error if systemctl is unavailable or returns error
systemctl disable nohang.service || true
@@ -40,7 +38,7 @@ uninstall:
rm -fv $(PREFIX)/lib/systemd/system/nohang.service
rm -fvr $(PREFIX)/etc/nohang/
rm -fvr $(PREFIX)/var/log/nohang/
systemd:
systemctl daemon-reload
systemctl enable nohang.service