changeset 1051:403a87c8d0b4

misc: add User/Group options in irccd.service
author David Demelier <markand@malikania.fr>
date Sun, 20 Jun 2021 12:28:33 +0200
parents 892a11180067
children 8904cd227948
files GNUmakefile systemd/irccd.service
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/GNUmakefile	Sun Jun 20 12:28:09 2021 +0200
+++ b/GNUmakefile	Sun Jun 20 12:28:33 2021 +0200
@@ -27,6 +27,8 @@
 MANDIR=         ${PREFIX}/share/man
 SHAREDIR=       ${PREFIX}/share
 VARDIR=         ${PREFIX}/var
+USER=           nobody
+GROUP=          nobody
 
 SSL=            1
 JS=             1
@@ -173,6 +175,7 @@
 
 ifeq (${OS},Linux)
 LIBS+=          -l dl
+CFLAGS+=        -fPIC
 endif
 
 LIBS+=          $(shell pkg-config --libs libbsd-overlay)
@@ -194,7 +197,6 @@
 SED.js=         /@define WITH_JS@/d
 endif
 
-
 ifeq (${OS},Darwin)
 SHFLAGS=        -undefined dynamic_lookup
 else
@@ -310,6 +312,8 @@
 install-systemd:
 	mkdir -p ${DESTDIR}${LIBDIR}/systemd/system
 	sed -e "s,@PATH@,${BINDIR}/irccd," \
+		-e "s,@USER@,${USER}," \
+		-e "s,@GROUP@,${GROUP}," \
 		< systemd/irccd.service \
 		> ${DESTDIR}${LIBDIR}/systemd/system/irccd.service
 
--- a/systemd/irccd.service	Sun Jun 20 12:28:09 2021 +0200
+++ b/systemd/irccd.service	Sun Jun 20 12:28:33 2021 +0200
@@ -4,6 +4,8 @@
 
 [Service]
 ExecStart=@PATH@
+User=@USER@
+Group=@GROUP@
 
 [Install]
 WantedBy=multi-user.target