Commit 2674c25b authored by Bryan Quigley's avatar Bryan Quigley

Add generated systemd unit

Both Fedora and Debian have their own systemd units for boinc;
this is based on elements of both so we stop duplicating effort.

This also adds minimal confinement to protect the home directories.

Also added clean to init.d script and made it only install if a
init.d directory already exists.

Closes: #2255
parent 28d425c0
......@@ -81,6 +81,7 @@ boinc_path_config.py
pkginfo
prototype
client/scripts/boinc-client
client/scripts/boinc-client.service
config.h
config.log
config.status
......
......@@ -2,16 +2,28 @@
install-exec-hook:
chmod +x boinc-client
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/init.d
$(INSTALL) -b boinc-client $(DESTDIR)$(sysconfdir)/init.d/boinc-client
if [ -d /etc/init.d ] ; then \
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/init.d ; \
$(INSTALL) -b boinc-client $(DESTDIR)$(sysconfdir)/init.d/boinc-client ; \
fi
if [ -d /usr/lib/systemd/system ] ; then \
$(INSTALL) -d $(DESTDIR)/usr/lib/systemd/system/ ; \
$(INSTALL_DATA) boinc-client.service $(DESTDIR)/usr/lib/systemd/system/boinc-client.service ; \
elif [ -d /lib/systemd/system ] ; then \
$(INSTALL) -d $(DESTDIR)/lib/systemd/system/ ; \
$(INSTALL_DATA) boinc-client.service $(DESTDIR)/lib/systemd/system/boinc-client.service ; \
fi
if [ -d /etc/sysconfig ] ; then \
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/sysconfig ; \
$(INSTALL) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/sysconfig/boinc-client ; \
$(INSTALL_DATA) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/sysconfig/boinc-client ; \
elif [ -d /etc/default ] ; then \
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/default ; \
$(INSTALL) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/default/boinc-client ; \
$(INSTALL_DATA) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/default/boinc-client ; \
else \
$(INSTALL) -d $(DESTDIR)$(sysconfdir) ; \
$(INSTALL) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/boinc-client.conf ; \
$(INSTALL_DATA) $(srcdir)/boinc-client.conf $(DESTDIR)$(sysconfdir)/boinc-client.conf ; \
fi
clean:
rm boinc-client.service
rm boinc-client
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
Documentation=man:boinc(1)
After=network-online.target
[Service]
ProtectHome=true
Type=simple
Nice=10
User=boinc
WorkingDirectory=~
ExecStart=@exec_prefix@/bin/boinc
ExecStop=@exec_prefix@/bin/boinccmd --quit
ExecReload=@exec_prefix@/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f lockfile
IOSchedulingClass=idle
[Install]
WantedBy=multi-user.target
......@@ -1302,6 +1302,7 @@ AC_CONFIG_FILES([
client/win/boinc_path_config.py:py/boinc_path_config.py.in
client/scripts/Makefile
client/scripts/boinc-client
client/scripts/boinc-client.service
db/Makefile
doc/Makefile
doc/manpages/Makefile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment