summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/server
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2016-12-01 11:37:20 -0500
committerJan Cholasta <jcholast@redhat.com>2017-02-15 07:13:37 +0100
commit38c66896de1769077cd5b057133606ec5eeaf62b (patch)
tree579031e3d54e8aec702abd60a39fbaff9f8f3209 /ipaserver/install/server
parentc894ebefc5c4c4c7ea340d6ddc4cd3c081917e4a (diff)
downloadfreeipa-38c66896de1769077cd5b057133606ec5eeaf62b.tar.gz
freeipa-38c66896de1769077cd5b057133606ec5eeaf62b.tar.xz
freeipa-38c66896de1769077cd5b057133606ec5eeaf62b.zip
Generate tmpfiles config at install time
We do not want to generate runtime directories just because the packages are installed, but only if the server is actually setup and run. Also this will be needed later because we will create a user at install time and some tmpfiles will need to be owned by this user. As we are changing this code also rationalize the directory structure and move it from the http rundir to the ipa specific rundir. https://fedorahosted.org/freeipa/ticket/5959 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/server')
-rw-r--r--ipaserver/install/server/install.py6
-rw-r--r--ipaserver/install/server/replicainstall.py3
-rw-r--r--ipaserver/install/server/upgrade.py4
3 files changed, 13 insertions, 0 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index 8628572a7..c2bcc1c32 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -709,6 +709,9 @@ def install(installer):
if installer._update_hosts_file:
update_hosts_file(ip_addresses, host_name, fstore)
+ # Make sure tmpfiles dir exist before installing components
+ tasks.create_tmpfiles_dirs()
+
http_instance = httpinstance.HTTPInstance()
http_instance.create_cert_db()
@@ -878,6 +881,9 @@ def install(installer):
except Exception:
raise ScriptError("Configuration of client side components failed!")
+ # Make sure the files we crated in /var/run are recreated at startup
+ tasks.configure_tmpfiles()
+
# Everything installed properly, activate ipa service.
services.knownservices.ipa.enable()
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 649184cbe..ed7203d6f 100644
--- a/ipaserver/install/server/replicainstall.py
+++ b/ipaserver/install/server/replicainstall.py
@@ -1301,6 +1301,9 @@ def install(installer):
conn = remote_api.Backend.ldap2
ccache = os.environ['KRB5CCNAME']
+ # Make sure tmpfiles dir exist before installing components
+ tasks.create_tmpfiles_dirs()
+
if promote:
if installer._add_to_ipaservers:
try:
diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
index 2bdf6eede..c7f0f9f44 100644
--- a/ipaserver/install/server/upgrade.py
+++ b/ipaserver/install/server/upgrade.py
@@ -1795,6 +1795,10 @@ def upgrade_check(options):
def upgrade():
+ # Do this early so that any code depending on these dirs will not fail
+ tasks.create_tmpfiles_dirs()
+ tasks.configure_tmpfiles()
+
realm = api.env.realm
schema_files = [os.path.join(paths.USR_SHARE_IPA_DIR, f) for f
in dsinstance.ALL_SCHEMA_FILES]