Add support for OpenRC
This commit is contained in:
parent
3f34a935b9
commit
90a7742b65
16
Makefile
16
Makefile
@ -68,6 +68,15 @@ build_deb: base units
|
||||
|
||||
install: base units chcon daemon-reload
|
||||
|
||||
openrc:
|
||||
install -d $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||
-sed "s|:TARGET_SBINDIR:|$(SBINDIR)|g;s|:TARGET_SYSCONFDIR:|$(SYSCONFDIR)|g" nohang/openrc/nohang.in > nohang/openrc/nohang
|
||||
-sed "s|:TARGET_SBINDIR:|$(SBINDIR)|g;s|:TARGET_SYSCONFDIR:|$(SYSCONFDIR)|g" nohang/openrc/nohang-desktop.in > nohang/openrc/nohang-desktop
|
||||
install -m0775 nohang/openrc/nohang $(DESTDIR)$(SYSCONFDIR)/init.d/nohang
|
||||
install -m0775 nohang/openrc/nohang-desktop $(DESTDIR)$(SYSCONFDIR)/init.d/nohang-desktop
|
||||
|
||||
install-openrc: base openrc
|
||||
|
||||
uninstall:
|
||||
# 'make uninstall' must not fail with error if systemctl is unavailable or returns error
|
||||
-systemctl stop nohang.service || true
|
||||
@ -90,3 +99,10 @@ uninstall:
|
||||
rm -fvr $(DESTDIR)$(LOGDIR)/nohang/
|
||||
rm -fvr $(DESTDIR)$(DOCDIR)/
|
||||
rm -fvr $(DESTDIR)$(DATADIR)/nohang/
|
||||
|
||||
uninstall-openrc: uninstall
|
||||
# 'make uninstall-openrc' must not fail with error if openrc is unavailable or returns error
|
||||
-rc-service nohang-desktop stop || true
|
||||
-rc-service nohang stop || true
|
||||
rm -fv /etc/init.d/nohang-desktop
|
||||
rm -fv /etc/init.d/nohang
|
||||
|
8
nohang/openrc/nohang-desktop.in
Executable file
8
nohang/openrc/nohang-desktop.in
Executable file
@ -0,0 +1,8 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="nohang-desktop daemon"
|
||||
description="Sophisticated low memory handler"
|
||||
command=:TARGET_SBINDIR:/nohang
|
||||
command_args="--monitor --config :TARGET_SYSCONFDIR:/nohang/nohang-desktop.conf"
|
||||
pidfile="/var/run/nohang-desktop"
|
||||
start_stop_daemon_args="--background --make-pidfile"
|
8
nohang/openrc/nohang.in
Executable file
8
nohang/openrc/nohang.in
Executable file
@ -0,0 +1,8 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="nohang daemon"
|
||||
description="Sophisticated low memory handler"
|
||||
command=:TARGET_SBINDIR:/nohang
|
||||
command_args="--monitor --config :TARGET_SYSCONFDIR:/nohang/nohang.conf"
|
||||
pidfile="/var/run/nohang"
|
||||
start_stop_daemon_args="--background --make-pidfile"
|
Loading…
Reference in New Issue
Block a user