summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-11-03 11:03:03 +0100
committerMartin Babinsky <mbabinsk@redhat.com>2016-11-09 13:08:32 +0100
commit288d624336d502a7df9856cdc2f6543b6e7c0b79 (patch)
tree963009cf0594db73bba8c58ae6510f5be74be9c6 /init
parenta027bf739848371fa91b5ba9766e031c9003d322 (diff)
downloadfreeipa-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>
Diffstat (limited to 'init')
-rw-r--r--init/Makefile.am20
-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.conf5
-rw-r--r--init/ipa_memcached.in5
-rw-r--r--init/systemd/Makefile.am24
-rw-r--r--init/systemd/ipa-custodia.service.in (renamed from init/systemd/ipa-custodia.service)2
-rw-r--r--init/systemd/ipa.conf.tmpfiles5
-rw-r--r--init/systemd/ipa.service.in (renamed from init/systemd/ipa.service)4
-rw-r--r--init/systemd/ipa_memcached.service12
-rw-r--r--init/systemd/ipa_memcached.service.in12
-rw-r--r--init/tmpfilesd/Makefile.am10
-rw-r--r--init/tmpfilesd/ipa.conf.in5
13 files changed, 79 insertions, 25 deletions
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