From: Wulf C. Krueger Date: Sun, 7 Oct 2012 09:06:14 +0000 (+0200) Subject: Add a systemd unit to start irkerd X-Git-Tag: 1.9~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6810ce998355d231c0285c1136bbdd7c2131e25f;p=irker.git Add a systemd unit to start irkerd Signed-off-by: Eric S. Raymond --- diff --git a/Makefile b/Makefile index 06f4fc4..4017d05 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # Makefile for the irker relaying daemon VERS=$(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd) +SYSTEMDSYSTEMUNITDIR:=$(shell pkg-config --variable=systemdsystemunitdir systemd) docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1 @@ -22,6 +23,10 @@ hacking.html: hacking.txt install: irkerd.8 irkerhook.1 uninstall install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/bin/ install -m 755 -o 0 -g 0 irkerd $(DESTDIR)/usr/bin/irkerd +ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),) + install -m 755 -o 0 -g 0 -d $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) + install -m 644 -o 0 -g 0 irkerd.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) +endif install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man8/ install -m 755 -o 0 -g 0 irkerd.8 $(DESTDIR)/usr/share/man/man8/irkerd.8 install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man1/ @@ -29,6 +34,9 @@ install: irkerd.8 irkerhook.1 uninstall uninstall: rm -f $(DESTDIR)/usr/bin/irkerd +ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),) + rm -f $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service +endif rm -f $(DESTDIR)/usr/share/man/man8/irkerd.8 rm -f $(DESTDIR)/usr/share/man/man1/irkerhook.1 @@ -48,7 +56,7 @@ loc: SOURCES = README COPYING NEWS install.txt security.txt hacking.txt \ irkerd irkerhook.py filter-example.py filter-test.py irk \ Makefile irkerd.xml irkerhook.xml -EXTRA_DIST = irker-logo.png org.catb.irkerd.plist +EXTRA_DIST = irker-logo.png org.catb.irkerd.plist irkerd.service version: @echo $(VERS) diff --git a/irkerd.service b/irkerd.service new file mode 100644 index 0000000..d19378b --- /dev/null +++ b/irkerd.service @@ -0,0 +1,12 @@ +# Copyright 2012 Wulf C. Krueger +# Distributed under the terms of the BSD LICENSE + +[Unit] +Description=irker daemon +Requires=network.target + +[Service] +ExecStart=/usr/bin/irkerd + +[Install] +WantedBy=multi-user.target