fix logging
This commit is contained in:
parent
3fc75353c4
commit
db0eea2213
3
Makefile
3
Makefile
@ -17,6 +17,8 @@ install:
|
||||
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
|
||||
@ -37,6 +39,7 @@ uninstall:
|
||||
rm -fv $(PREFIX)/usr/share/man/man1/oom-trigger.1.gz
|
||||
rm -fv $(PREFIX)/lib/systemd/system/nohang.service
|
||||
rm -fvr $(PREFIX)/etc/nohang/
|
||||
rm -fvr $(PREFIX)/var/log/nohang/
|
||||
|
||||
systemd:
|
||||
systemctl daemon-reload
|
||||
|
16
nohang
16
nohang
@ -14,6 +14,9 @@ from logging import basicConfig
|
||||
from logging import info
|
||||
|
||||
|
||||
start_time = time()
|
||||
|
||||
|
||||
logfile = '/var/log/nohang/nohang.log'
|
||||
|
||||
|
||||
@ -22,8 +25,7 @@ basicConfig(filename=logfile,
|
||||
format="%(asctime)s: %(message)s")
|
||||
|
||||
|
||||
separate_log = True
|
||||
|
||||
separate_log = False
|
||||
|
||||
|
||||
def log(msg):
|
||||
@ -33,16 +35,6 @@ def log(msg):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
start_time = time()
|
||||
|
||||
|
||||
help_mess = """usage: nohang [-h] [-c CONFIG]
|
||||
|
||||
optional arguments:
|
||||
|
@ -7,7 +7,6 @@ Documentation=man:nohang(1) https://github.com/hakavlad/nohang
|
||||
ExecStart=/usr/sbin/nohang --config /etc/nohang/nohang.conf
|
||||
Slice=nohang.slice
|
||||
Restart=always
|
||||
ProtectSystem=strict
|
||||
MemoryMax=100M
|
||||
TasksMax=100
|
||||
OOMScoreAdjust=-10
|
||||
|
Loading…
Reference in New Issue
Block a user