tstclair pushed to mesos (f21). "WIP update for complete systemd and sysconfig integration"

notifications at fedoraproject.org notifications at fedoraproject.org
Mon Mar 30 18:29:15 UTC 2015


>From 46a3c02265c1e11ee5e265e2d68c4faad636872e Mon Sep 17 00:00:00 2001
From: "Timothy St. Clair" <tstclair at redhat.com>
Date: Wed, 1 Oct 2014 11:10:56 -0500
Subject: WIP update for complete systemd and sysconfig integration


diff --git a/mesos-master b/mesos-master
new file mode 100644
index 0000000..a40ec32
--- /dev/null
+++ b/mesos-master
@@ -0,0 +1,12 @@
+# This file contains environment variables that are passed to mesos-master.
+# To get a description of all options run mesos-master --help; any option
+# supported as a command-line option is also supported as an environment
+# variable.
+
+# Some options you're likely to want to set:
+MESOS_log_dir=/var/log/mesos
+MESOS_work_dir=/var/run/mesos
+MESOS_port=5050
+
+# For isolated sandbox testing
+#MESOS_ip=127.0.0.1
diff --git a/mesos-master-env.sh b/mesos-master-env.sh
deleted file mode 100644
index 211db5d..0000000
--- a/mesos-master-env.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file contains environment variables that are passed to mesos-master.
-# To get a description of all options run mesos-master --help; any option
-# supported as a command-line option is also supported as an environment
-# variable.
-
-# Some options you're likely to want to set:
-export MESOS_log_dir=/var/log/mesos
-export MESOS_work_dir=/var/run/mesos
-export MESOS_port=5050
-
-# For isolated sandbox testing
-#export MESOS_ip=127.0.0.1
diff --git a/mesos-master.service b/mesos-master.service
index f6be194..5434bc1 100644
--- a/mesos-master.service
+++ b/mesos-master.service
@@ -5,8 +5,8 @@ After=network.target
 Wants=network.target
 
 [Service]
-Type=forking
-ExecStart=/usr/sbin/mesos-daemon.sh mesos-master
+EnvironmentFile=/etc/sysconfig/mesos-master
+ExecStart=/usr/sbin/mesos-master $MESOS_MASTER_OPTS
 ExecStop=/usr/bin/killall -s 15 mesos-master
 ExecReload=/bin/kill -HUP $MAINPID
 User=root
diff --git a/mesos-slave b/mesos-slave
new file mode 100644
index 0000000..096e94e
--- /dev/null
+++ b/mesos-slave
@@ -0,0 +1,21 @@
+# This file contains environment variables that are passed to mesos-slave.
+# To get a description of all options run mesos-slave --help; any option
+# supported as a command-line option is also supported as an environment
+# variable.
+
+# The mesos master URL to contact. Should be host:port for
+# non-ZooKeeper based masters, otherwise a zk:// or file:// URL.
+MESOS_master=$HOSTNAME:5050
+
+# For isolated sandbox testing
+#MESOS_master=127.0.0.1:5050
+
+# For a complete listing of options execute 'mesos-slave --help'
+MESOS_log_dir=/var/log/mesos
+MESOS_work_dir=/var/run/mesos
+MESOS_containerizers=docker,mesos
+
+# systemd cgroup integration
+MESOS_isolation='cgroups/cpu,cgroups/mem'
+MESOS_cgroups_root='system.slice/mesos-slave.service'
+MESOS_cgroups_hierarchy=/sys/fs/cgroup
diff --git a/mesos-slave-env.sh b/mesos-slave-env.sh
deleted file mode 100644
index 02284e0..0000000
--- a/mesos-slave-env.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-# This file contains environment variables that are passed to mesos-slave.
-# To get a description of all options run mesos-slave --help; any option
-# supported as a command-line option is also supported as an environment
-# variable.
-
-# You must at least set MESOS_master.
-
-# The mesos master URL to contact. Should be host:port for
-# non-ZooKeeper based masters, otherwise a zk:// or file:// URL.
-export MESOS_master=$HOSTNAME:5050
-
-# For isolated sandbox testing
-#export MESOS_master=127.0.0.1:5050
-
-# For a complete listing of options execute 'mesos-slave --help'
-export MESOS_log_dir=/var/log/mesos
-export MESOS_work_dir=/var/run/mesos
-export MESOS_containerizers=docker,mesos
-
-# systemd cgroup integration
-export MESOS_isolation='cgroups/cpu,cgroups/mem'
-export MESOS_cgroups_root='system.slice/mesos-slave.service'
-export MESOS_cgroups_hierarchy=/sys/fs/cgroup
-
diff --git a/mesos-slave.service b/mesos-slave.service
index e2b7513..2df6bd2 100644
--- a/mesos-slave.service
+++ b/mesos-slave.service
@@ -5,8 +5,8 @@ After=network.target
 Wants=network.target
 
 [Service]
-Type=forking
-ExecStart=/usr/sbin/mesos-daemon.sh mesos-slave
+EnvironmentFile=/etc/sysconfig/mesos-slave
+ExecStart=/usr/sbin/mesos-slave $MESOS_SLAVE_OPTS
 ExecStop=/usr/bin/killall -s 15 mesos-slave
 ExecReload=/bin/kill -HUP $MAINPID
 #######################################
diff --git a/mesos.spec b/mesos.spec
index 61b0deb..ec876bf 100644
--- a/mesos.spec
+++ b/mesos.spec
@@ -17,7 +17,7 @@
 
 Name:          mesos
 Version:       0.21.0
-Release:       1.SNAPSHOT.%{shortcommit}%{?dist}
+Release:       2.SNAPSHOT.%{shortcommit}%{?dist}
 Summary:       Cluster manager for sharing distributed application frameworks
 License:       ASL 2.0
 URL:           http://mesos.apache.org/
@@ -26,8 +26,8 @@ Source0:       https://github.com/apache/mesos/archive/%{commit}/%{name}-%{versi
 Source1:       %{name}-tmpfiles.conf
 Source2:       %{name}-master.service
 Source3:       %{name}-slave.service
-Source4:       %{name}-master-env.sh
-Source5:       %{name}-slave-env.sh
+Source4:       %{name}-master
+Source5:       %{name}-slave
 
 ####################################
 Patch0:        mesos-0.21-integ.patch
@@ -160,7 +160,8 @@ autoreconf -vfi
 %configure --disable-static
 %endif
 
-make %{?_smp_mflags}
+make
+#%{?_smp_mflags}
 
 %check
 ######################################
@@ -221,15 +222,20 @@ mkdir -p %{buildroot}%{_sysconfdir}/%{name}
 mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d
 install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
 
-install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}
-install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/%{name}
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig
+install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig
+
+# NOTE: The following removes the deployment scripts and tooling.
+# It's still debatable if we should use it.
+rm -rf %{buildroot}%{_sysconfdir}/%{name}
+rm -f  %{buildroot}%{_sbindir}/mesos-*.sh
 
 mkdir -p -m0755 %{buildroot}/%{_var}/log/%{name}
 mkdir -p -m0755 %{buildroot}/%{_var}/lib/%{name}
 mkdir -p %{buildroot}%{_unitdir}
 install -m 0644 %{SOURCE2} %{SOURCE3} %{buildroot}%{_unitdir}/
 
-
 ######################
 # install java bindings
 ######################
@@ -244,13 +250,12 @@ install -m 0644 %{SOURCE2} %{SOURCE3} %{buildroot}%{_unitdir}/
 %{_sbindir}/mesos-*
 %{_datadir}/%{name}/
 %{_libexecdir}/%{name}/
-#system integration aspects
-%{_sysconfdir}/%{name}/*.template
+#system integration files
 %{python_sitelib}/%{name}/
 %attr(0755,mesos,mesos) %{_var}/log/%{name}/
 %attr(0755,mesos,mesos) %{_var}/lib/%{name}/
 %config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
-%config(noreplace) %{_sysconfdir}/%{name}/*env.sh
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}*
 %{_unitdir}/%{name}*.service
 
 ######################
@@ -299,9 +304,12 @@ exit 0
 /sbin/ldconfig
 
 %changelog
+* Tue Sep 30 2014 Timothy St. Clair <tstclair at redhat.com> - 0.21.0-2.SNAPSHOT.3133734
+- Removing scripts and updating systemd settings.
+
 * Tue Sep 23 2014 Timothy St. Clair <tstclair at redhat.com> - 0.21.0-1.SNAPSHOT.3133734
-- Initial prototyping  
- 
+- Initial prototyping
+
 * Wed Aug 27 2014 Timothy St. Clair <tstclair at redhat.com> - 0.20.0-2.f421ffd
 - Fixes for system integration
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/mesos.git/commit/?h=f21&id=46a3c02265c1e11ee5e265e2d68c4faad636872e


More information about the scm-commits mailing list