diff options
author | Petr Spacek <pspacek@redhat.com> | 2016-11-03 11:03:03 +0100 |
---|---|---|
committer | Martin Babinsky <mbabinsk@redhat.com> | 2016-11-09 13:08:32 +0100 |
commit | 288d624336d502a7df9856cdc2f6543b6e7c0b79 (patch) | |
tree | 963009cf0594db73bba8c58ae6510f5be74be9c6 | |
parent | a027bf739848371fa91b5ba9766e031c9003d322 (diff) | |
download | freeipa-288d624336d502a7df9856cdc2f6543b6e7c0b79.tar.gz freeipa-288d624336d502a7df9856cdc2f6543b6e7c0b79.tar.xz freeipa-288d624336d502a7df9856cdc2f6543b6e7c0b79.zip |
Build: integrate init and init/systemd into build system
At the same time, I've renamed tmpfilesd config file to static name
"ipa.conf" instead of using package-specific name. It had no purpose
and just complicated build and packaging.
Variable substitution into configuration has to be done in Makefile
and not in Autoconf as documented in:
Autoconf v2.69 manual chapter 4.8.2 Installation Directory Variables:
... Most of these variables have values that rely on prefix or
exec_prefix. ... Similarly, you should not rely on AC_CONFIG_FILES
to replace bindir and friends in your shell scripts and other files;
instead, let make manage their replacement.
https://fedorahosted.org/freeipa/ticket/6418
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | freeipa.spec.in | 17 | ||||
-rw-r--r-- | init/Makefile.am | 20 | ||||
-rw-r--r-- | init/ipa-dnskeysyncd (renamed from init/ipa-dnskeysyncd.conf) | 0 | ||||
-rw-r--r-- | init/ipa-ods-exporter (renamed from init/ipa-ods-exporter.conf) | 0 | ||||
-rw-r--r-- | init/ipa_memcached.conf | 5 | ||||
-rw-r--r-- | init/ipa_memcached.in | 5 | ||||
-rw-r--r-- | init/systemd/Makefile.am | 24 | ||||
-rw-r--r-- | init/systemd/ipa-custodia.service.in (renamed from init/systemd/ipa-custodia.service) | 2 | ||||
-rw-r--r-- | init/systemd/ipa.conf.tmpfiles | 5 | ||||
-rw-r--r-- | init/systemd/ipa.service.in (renamed from init/systemd/ipa.service) | 4 | ||||
-rw-r--r-- | init/systemd/ipa_memcached.service | 12 | ||||
-rw-r--r-- | init/systemd/ipa_memcached.service.in | 12 | ||||
-rw-r--r-- | init/tmpfilesd/Makefile.am | 10 | ||||
-rw-r--r-- | init/tmpfilesd/ipa.conf.in | 5 |
17 files changed, 100 insertions, 44 deletions
diff --git a/.gitignore b/.gitignore index 38c21d6c4..397ae92a2 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,13 @@ freeipa2-dev-doc /po/test.po /po/test_locale/xh_ZA/LC_MESSAGES/ipa.mo + +/init/ipa_memcached +/init/systemd/ipa-custodia.service +/init/systemd/ipa.service +/init/systemd/ipa_memcached.service +/init/tmpfilesd/ipa.conf + !/install/ui/doc/Makefile.in /install/ui/release /install/ui/css/ipa.css diff --git a/Makefile.am b/Makefile.am index e752585d8..6f9015540 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,5 @@ -SUBDIRS = asn1 util client contrib daemons install ipaclient ipalib ipaplatform ipapython ipaserver ipatests po +SUBDIRS = asn1 util client contrib daemons init install ipaclient ipalib ipaplatform ipapython ipaserver ipatests po # doc -# init MOSTLYCLEANFILES = ipasetup.pyc ipasetup.pyo diff --git a/configure.ac b/configure.ac index 1a6e489a0..0fafe0d38 100644 --- a/configure.ac +++ b/configure.ac @@ -241,7 +241,7 @@ dnl --------------------------------------------------------------------------- PKG_CHECK_MODULES([INI], [ini_config >= 1.2.0]) dnl --------------------------------------------------------------------------- -dnl - Check for systemd unit directory +dnl - Check for systemd directories dnl --------------------------------------------------------------------------- PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])]) AC_ARG_WITH([systemdsystemunitdir], @@ -251,6 +251,13 @@ AC_ARG_WITH([systemdsystemunitdir], [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)]) AC_SUBST([systemdsystemunitdir]) +AC_ARG_WITH([systemdtmpfilesdir], + AS_HELP_STRING([--with-systemdtmpfilesdir=DIR], + [Directory for systemd-tmpfiles configuration files]), + [systemdtmpfilesdir=$with_systemdtmpfilesdir], + [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)]) +AC_SUBST([systemdtmpfilesdir]) + dnl --------------------------------------------------------------------------- dnl - Get /etc/sysconfig directory path dnl --------------------------------------------------------------------------- @@ -451,6 +458,9 @@ AC_CONFIG_FILES([ daemons/ipa-slapi-plugins/topology/Makefile daemons/ipa-version.h freeipa.spec + init/systemd/Makefile + init/tmpfilesd/Makefile + init/Makefile install/Makefile install/certmonger/Makefile install/conf/Makefile @@ -510,6 +520,7 @@ echo " datadir: ${datadir} krb5rundir: ${krb5rundir} systemdsystemunitdir: ${systemdsystemunitdir} + systemdtmpfilesdir: ${systemdtmpfilesdir} source code location: ${srcdir} compiler: ${CC} cflags: ${CFLAGS} diff --git a/freeipa.spec.in b/freeipa.spec.in index 6a8d31386..41c56ca2b 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -792,9 +792,6 @@ mkdir -p %{buildroot}%{_usr}/share/ipa/html/ /bin/touch %{buildroot}%{_usr}/share/ipa/html/krb5.ini /bin/touch %{buildroot}%{_usr}/share/ipa/html/krbrealm.con mkdir -p %{buildroot}%{_initrddir} -install -m 644 init/ipa_memcached.conf %{buildroot}%{_sysconfdir}/sysconfig/ipa_memcached -install -m 644 init/ipa-dnskeysyncd.conf %{buildroot}%{_sysconfdir}/sysconfig/ipa-dnskeysyncd -install -m 644 init/ipa-ods-exporter.conf %{buildroot}%{_sysconfdir}/sysconfig/ipa-ods-exporter # Web UI plugin dir mkdir -p %{buildroot}%{_usr}/share/ipa/ui/js/plugins @@ -803,11 +800,6 @@ mkdir -p %{buildroot}%{_usr}/share/ipa/ui/js/plugins mkdir -p %{buildroot}%{_sysconfdir}/ipa/kdcproxy/ install -m 644 install/share/kdcproxy.conf %{buildroot}%{_sysconfdir}/ipa/kdcproxy/kdcproxy.conf -# NOTE: systemd specific section -mkdir -p %{buildroot}%{_tmpfilesdir} -install -m 0644 init/systemd/ipa.conf.tmpfiles %{buildroot}%{_tmpfilesdir}/%{name}.conf -# END - mkdir -p %{buildroot}%{_localstatedir}/run/ install -d -m 0700 %{buildroot}%{_localstatedir}/run/ipa_memcached/ install -d -m 0700 %{buildroot}%{_localstatedir}/run/ipa/ @@ -818,13 +810,6 @@ install -d -m 0700 %{buildroot}%{_localstatedir}/run/httpd/ipa/krbcache mkdir -p %{buildroot}%{_libdir}/krb5/plugins/libkrb5 touch %{buildroot}%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so -# NOTE: systemd specific section -mkdir -p %{buildroot}%{_unitdir} -mkdir -p %{buildroot}%{etc_systemd_dir} -install -m 644 init/systemd/ipa.service %{buildroot}%{_unitdir}/ipa.service -install -m 644 init/systemd/ipa_memcached.service %{buildroot}%{_unitdir}/ipa_memcached.service -install -m 644 init/systemd/ipa-custodia.service %{buildroot}%{_unitdir}/ipa-custodia.service -# END mkdir -p %{buildroot}/%{_localstatedir}/lib/ipa/backup %endif # ONLY_CLIENT @@ -1132,7 +1117,7 @@ fi %dir %attr(0700,apache,apache) %{_localstatedir}/run/httpd/ipa/clientcaches/ %dir %attr(0700,apache,apache) %{_localstatedir}/run/httpd/ipa/krbcache/ # NOTE: systemd specific section -%{_tmpfilesdir}/%{name}.conf +%{_tmpfilesdir}/ipa.conf %attr(644,root,root) %{_unitdir}/ipa_memcached.service %attr(644,root,root) %{_unitdir}/ipa-custodia.service %ghost %attr(644,root,root) %{etc_systemd_dir}/httpd.d/ipa.conf diff --git a/init/Makefile.am b/init/Makefile.am new file mode 100644 index 000000000..47f844ac1 --- /dev/null +++ b/init/Makefile.am @@ -0,0 +1,20 @@ +# This file will be processed with automake-1.7 to create Makefile.in +# +AUTOMAKE_OPTIONS = 1.7 + +SUBDIRS = systemd tmpfilesd + +dist_sysconfenv_DATA = \ + ipa-dnskeysyncd \ + ipa-ods-exporter + +nodist_sysconfenv_DATA = \ + ipa_memcached + +CLEANFILES = $(nodist_sysconfenv_DATA) + +dist_noinst_DATA = \ + ipa_memcached.in + +%: %.in Makefile + sed -e 's|@localstatedir[@]|$(localstatedir)|g' '$(srcdir)/$@.in' >$@ diff --git a/init/ipa-dnskeysyncd.conf b/init/ipa-dnskeysyncd index e69de29bb..e69de29bb 100644 --- a/init/ipa-dnskeysyncd.conf +++ b/init/ipa-dnskeysyncd diff --git a/init/ipa-ods-exporter.conf b/init/ipa-ods-exporter index e69de29bb..e69de29bb 100644 --- a/init/ipa-ods-exporter.conf +++ b/init/ipa-ods-exporter diff --git a/init/ipa_memcached.conf b/init/ipa_memcached.conf deleted file mode 100644 index 19d912742..000000000 --- a/init/ipa_memcached.conf +++ /dev/null @@ -1,5 +0,0 @@ -SOCKET_PATH=/var/run/ipa_memcached/ipa_memcached -USER=apache -MAXCONN=1024 -CACHESIZE=64 -OPTIONS= diff --git a/init/ipa_memcached.in b/init/ipa_memcached.in new file mode 100644 index 000000000..56701383d --- /dev/null +++ b/init/ipa_memcached.in @@ -0,0 +1,5 @@ +SOCKET_PATH=@localstatedir@/run/ipa_memcached/ipa_memcached +USER=apache +MAXCONN=1024 +CACHESIZE=64 +OPTIONS= diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am new file mode 100644 index 000000000..e978fe974 --- /dev/null +++ b/init/systemd/Makefile.am @@ -0,0 +1,24 @@ +# This file will be processed with automake-1.7 to create Makefile.in +# +AUTOMAKE_OPTIONS = 1.7 + +dist_noinst_DATA = \ + ipa-custodia.service.in \ + ipa_memcached.service.in \ + ipa.service.in + +systemdsystemunit_DATA = \ + ipa-custodia.service \ + ipa_memcached.service \ + ipa.service + +CLEANFILES = $(systemdsystemunit_DATA) + +%: %.in Makefile + sed \ + -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@IPA_SYSCONF_DIR[@]|$(IPA_SYSCONF_DIR)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfenvdir[@]|$(sysconfenvdir)|g' \ + '$(srcdir)/$@.in' >$@ diff --git a/init/systemd/ipa-custodia.service b/init/systemd/ipa-custodia.service.in index ff930fbbb..3f9b128aa 100644 --- a/init/systemd/ipa-custodia.service +++ b/init/systemd/ipa-custodia.service.in @@ -4,7 +4,7 @@ Description=IPA Custodia Service [Service] Type=simple -ExecStart=/usr/sbin/custodia /etc/ipa/custodia/custodia.conf +ExecStart=@sbindir@/custodia @IPA_SYSCONF_DIR@/custodia/custodia.conf PrivateTmp=yes Restart=on-failure RestartSec=60s diff --git a/init/systemd/ipa.conf.tmpfiles b/init/systemd/ipa.conf.tmpfiles deleted file mode 100644 index 6eab2621c..000000000 --- a/init/systemd/ipa.conf.tmpfiles +++ /dev/null @@ -1,5 +0,0 @@ -d /var/run/ipa_memcached 0700 apache apache -d /var/run/ipa 0700 root root -d /var/run/httpd/ipa 0700 apache apache -d /var/run/httpd/ipa/clientcaches 0700 apache apache -d /var/run/httpd/ipa/krbcache 0700 apache apache diff --git a/init/systemd/ipa.service b/init/systemd/ipa.service.in index 8cfcf7c54..9acd587e5 100644 --- a/init/systemd/ipa.service +++ b/init/systemd/ipa.service.in @@ -5,8 +5,8 @@ After=network.target [Service] Type=oneshot -ExecStart=/usr/sbin/ipactl start -ExecStop=/usr/sbin/ipactl stop +ExecStart=@sbindir@/ipactl start +ExecStop=@sbindir@/ipactl stop RemainAfterExit=yes TimeoutSec=0 diff --git a/init/systemd/ipa_memcached.service b/init/systemd/ipa_memcached.service deleted file mode 100644 index a4857cd4a..000000000 --- a/init/systemd/ipa_memcached.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=IPA memcached daemon, increases IPA server performance -After=network.target - -[Service] -Type=forking -EnvironmentFile=/etc/sysconfig/ipa_memcached -PIDFile=/var/run/ipa_memcached/ipa_memcached.pid -ExecStart=/usr/bin/memcached -d -s $SOCKET_PATH -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/ipa_memcached/ipa_memcached.pid $OPTIONS - -[Install] -WantedBy=multi-user.target diff --git a/init/systemd/ipa_memcached.service.in b/init/systemd/ipa_memcached.service.in new file mode 100644 index 000000000..0e163203a --- /dev/null +++ b/init/systemd/ipa_memcached.service.in @@ -0,0 +1,12 @@ +[Unit] +Description=IPA memcached daemon, increases IPA server performance +After=network.target + +[Service] +Type=forking +EnvironmentFile=@sysconfenvdir@/ipa_memcached +PIDFile=@localstatedir@/run/ipa_memcached/ipa_memcached.pid +ExecStart=@bindir@/memcached -d -s $SOCKET_PATH -u $USER -m $CACHESIZE -c $MAXCONN -P @localstatedir@/run/ipa_memcached/ipa_memcached.pid $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/init/tmpfilesd/Makefile.am b/init/tmpfilesd/Makefile.am new file mode 100644 index 000000000..40b9cd5a5 --- /dev/null +++ b/init/tmpfilesd/Makefile.am @@ -0,0 +1,10 @@ +dist_noinst_DATA = \ + ipa.conf.in + +systemdtmpfiles_DATA = \ + ipa.conf + +CLEANFILES = $(systemdtmpfiles_DATA) + +%: %.in Makefile + sed -e 's|@localstatedir[@]|$(localstatedir)|g' '$(srcdir)/$@.in' >$@ diff --git a/init/tmpfilesd/ipa.conf.in b/init/tmpfilesd/ipa.conf.in new file mode 100644 index 000000000..4954000a3 --- /dev/null +++ b/init/tmpfilesd/ipa.conf.in @@ -0,0 +1,5 @@ +d @localstatedir@/run/ipa_memcached 0700 apache apache +d @localstatedir@/run/ipa 0700 root root +d @localstatedir@/run/httpd/ipa 0700 apache apache +d @localstatedir@/run/httpd/ipa/clientcaches 0700 apache apache +d @localstatedir@/run/httpd/ipa/krbcache 0700 apache apache |