summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJonathan Bauer2014-10-31 13:57:37 +0100
committerJonathan Bauer2014-10-31 13:57:37 +0100
commitebe5062f4b8a9969fb2cff6e1893ddccbf38b71e (patch)
treeb87f05dde198d732bf1836a317abb4a6fb2aed5c /server
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-ebe5062f4b8a9969fb2cff6e1893ddccbf38b71e.tar.gz
tm-scripts-ebe5062f4b8a9969fb2cff6e1893ddccbf38b71e.tar.xz
tm-scripts-ebe5062f4b8a9969fb2cff6e1893ddccbf38b71e.zip
[config] added openstack pam hooks scripts to start/stop openstack daemon on user logout/login
Diffstat (limited to 'server')
-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