From 37ff44429e1222a87d8b4afe2bd9f2c264838d73 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mon, 23 Jan 2012 13:56:42 -0700 Subject: [PATCH] Ticket #263 - add systemd include directive https://fedorahosted.org/389/ticket/263 Resolves: Ticket #263 Bug Description: add systemd include directive Reviewed by: ??? Branch: master Fix Description: Include the file /etc/sysconfig/dirsrv.systemd in the dirsrv@.service file, and add an empty /etc/sysconfig/dirsrv.systemd file. Applications that want to customize the dirsrv@.service file do not need to copy the file into /etc/systemd/system they can just edit the /etc/sysconfig/dirsrv.systemd file. Platforms tested: Fedora 16 Flag Day: no Doc impact: no --- Makefile.am | 9 +++++++++ Makefile.in | 9 ++++++++- wrappers/systemd.template.service.in | 8 +++++--- wrappers/systemd.template.sysconfig | 3 +++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 wrappers/systemd.template.sysconfig diff --git a/Makefile.am b/Makefile.am index 2f653b3..045c986 100644 --- a/Makefile.am +++ b/Makefile.am @@ -391,7 +391,12 @@ init_SCRIPTS = wrappers/$(PACKAGE_NAME) \ wrappers/$(PACKAGE_NAME)-snmp endif +if SYSTEMD +initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) \ + wrappers/$(PACKAGE_NAME).systemd +else initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) +endif inf_DATA = ldap/admin/src/slapd.inf \ ldap/admin/src/scripts/dscreate.map \ @@ -1544,6 +1549,10 @@ endif if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ +%/$(PACKAGE_NAME).systemd: %/systemd.template.sysconfig + if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi + $(fixupcmd) $^ > $@ + %/$(systemdgroupname): %/systemd.group.in if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ diff --git a/Makefile.in b/Makefile.in index ec0b5ba..b1d5c68 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1594,7 +1594,10 @@ task_SCRIPTS = ldap/admin/src/scripts/template-bak2db \ @SYSTEMD_FALSE@init_SCRIPTS = wrappers/$(PACKAGE_NAME) \ @SYSTEMD_FALSE@ wrappers/$(PACKAGE_NAME)-snmp -initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) +@SYSTEMD_FALSE@initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) +@SYSTEMD_TRUE@initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) \ +@SYSTEMD_TRUE@ wrappers/$(PACKAGE_NAME).systemd + inf_DATA = ldap/admin/src/slapd.inf \ ldap/admin/src/scripts/dscreate.map \ ldap/admin/src/scripts/dsupdate.map \ @@ -10640,6 +10643,10 @@ ns-slapd.properties: makstrdb if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ +%/$(PACKAGE_NAME).systemd: %/systemd.template.sysconfig + if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi + $(fixupcmd) $^ > $@ + %/$(systemdgroupname): %/systemd.group.in if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ diff --git a/wrappers/systemd.template.service.in b/wrappers/systemd.template.service.in index 68d796b..c36bc87 100644 --- a/wrappers/systemd.template.service.in +++ b/wrappers/systemd.template.service.in @@ -1,3 +1,5 @@ +# you usually do not want to edit this file - instead, edit the +# @initconfigdir@/@package_name@.systemd file instead - otherwise, # do not edit this file in /lib/systemd/system - instead, do the following: # cp /lib/systemd/system/dirsrv\@.service /etc/systemd/system/dirsrv\@.service # mkdir -p /etc/systemd/system/@systemdgroupname@.wants @@ -21,6 +23,6 @@ EnvironmentFile=@initconfigdir@/@package_name@ EnvironmentFile=@initconfigdir@/@package_name@-%i ExecStart=@sbindir@/ns-slapd -D @instconfigdir@/slapd-%i -i @localstatedir@/run/@package_name@/slapd-%i.pid -w @localstatedir@/run/@package_name@/slapd-%i.startpid ExecStopPost=/bin/rm -f @localstatedir@/run/@package_name@/slapd-%i.pid -# uncomment this line to raise the file descriptor limit - but do not edit this -# file in /lib/systemd/system - see above for instructions -# LimitNOFILE=8192 +# if you need to set other directives e.g. LimitNOFILE=8192 +# set them in this file +.include @initconfigdir@/@package_name@.systemd diff --git a/wrappers/systemd.template.sysconfig b/wrappers/systemd.template.sysconfig new file mode 100644 index 0000000..d88bdcd --- /dev/null +++ b/wrappers/systemd.template.sysconfig @@ -0,0 +1,3 @@ +[Service] +# uncomment this line to raise the file descriptor limit +# LimitNOFILE=8192 -- 1.7.1