summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_auth.d/00-openstack6
-rw-r--r--server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_ses_close.d/00-openstack9
2 files changed, 15 insertions, 0 deletions
diff --git a/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_auth.d/00-openstack b/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_auth.d/00-openstack
new file mode 100644
index 00000000..fc784208
--- /dev/null
+++ b/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_auth.d/00-openstack
@@ -0,0 +1,6 @@
+# To be sourced by /opt/openslx/scripts/pam_script_auth only
+
+# Stop the virtualization environment
+systemctl stop nova-compute.service &
+systemctl stop libvirt-bin.service &
+systemctl stop neutron-plugin-openvswitch-agent.service &
diff --git a/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_ses_close.d/00-openstack b/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_ses_close.d/00-openstack
new file mode 100644
index 00000000..34c6080a
--- /dev/null
+++ b/server/modules/openstack-pam-hooks/opt/openslx/scripts/pam_script_ses_close.d/00-openstack
@@ -0,0 +1,9 @@
+# To be sourced by /opt/openslx/scripts/pam_script_ses_close only
+
+# Start the virtualization environment again
+# check if another user is logged in
+if [ -z "$(who |grep '^[^root]')" ]; then
+ systemctl start nova-compute.service &
+ systemctl start libvirt-bin.service &
+ systemctl start neutron-plugin-openvswitch-agent.service &
+fi