* [meta-cgl][PATCH 1/5] openais: add systemd support
2017-05-26 8:46 [meta-cgl][PATCH 0/5] openais: add systemd support and several fixes jackie.huang
@ 2017-05-26 8:46 ` jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 2/5] openais: correct the use of proc name in init script jackie.huang
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jackie.huang @ 2017-05-26 8:46 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
inherit systemd and add .service for systemd support
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../recipes-cgl/openais/files/openais.service | 14 ++++++++++++++
meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb | 17 +++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais.service
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais.service b/meta-cgl-common/recipes-cgl/openais/files/openais.service
new file mode 100644
index 0000000..230e4bb
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OpenAIS Cluster Framework
+ConditionKernelCommandLine=!nocluster
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+ExecStart=@DATADIR@/openais/openais start
+ExecStop=@DATADIR@/openais/openais stop
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index e503cec..23da0a2 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -9,10 +9,23 @@ SRC_URI = " \
file://fix-lcrso-linkage.patch \
file://build-cleanup-configure-ac.patch \
file://openais-fix-bash.patch \
- "
+ file://openais.service \
+ "
+
SRC_URI[md5sum] = "e500ad3c49fdc45d8653f864e80ed82c"
SRC_URI[sha256sum] = "974b4959f3c401c16156dab31e65a6d45bbf84dd85a88c2a362712e738c06934"
-inherit autotools pkgconfig
+inherit autotools pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "openais.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${D}${sysconfdir}/init.d/openais ${D}${datadir}/${BPN}/openais
+ install -D -m 0644 ${WORKDIR}/openais.service ${D}${systemd_system_unitdir}/openais.service
+ sed -i -e 's,@DATADIR@,${datadir},g' ${D}${systemd_system_unitdir}/openais.service
+ fi
+}
FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [meta-cgl][PATCH 2/5] openais: correct the use of proc name in init script
2017-05-26 8:46 [meta-cgl][PATCH 0/5] openais: add systemd support and several fixes jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 1/5] openais: add systemd support jackie.huang
@ 2017-05-26 8:46 ` jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 3/5] openais: fix saTmrTimerReschedule test error jackie.huang
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jackie.huang @ 2017-05-26 8:46 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
openais actually runs on top of corosync. The init
script was checking for the pid of "openais"
rather than checking for corosync's pid.
Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../openais/files/openais-fix-init-script.patch | 42 ++++++++++++++++++++++
.../recipes-cgl/openais/openais_1.1.4.bb | 1 +
2 files changed, 43 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais-fix-init-script.patch
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais-fix-init-script.patch b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-init-script.patch
new file mode 100644
index 0000000..69fddd5
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-init-script.patch
@@ -0,0 +1,42 @@
+commit 367f4ab0b67266e07ffedcae2df74f2576ea2aeb
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Thu Jan 24 12:36:48 2013 -0500
+
+ openais: correct the use of proc name in init script
+
+ openais actually runs on top of corosync. The init
+ script was checking for the pid of "openais"
+ rather than checking for corosync's pid.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/init/generic.in b/init/generic.in
+index ac63a5f..e8efbb3 100644
+--- a/init/generic.in
++++ b/init/generic.in
+@@ -46,7 +46,7 @@ status()
+ if [ $rtrn -ne 0 ]; then
+ echo "$1 is stopped"
+ else
+- echo "$1 (pid $pid) is running..."
++ echo "$1 ($proc with pid $pid) is running..."
+ fi
+ return $rtrn
+ }
+@@ -130,12 +130,12 @@ restart|reload|force-reload)
+ restart
+ ;;
+ condrestart|try-restart)
+- if status $prog > /dev/null 2>&1; then
++ if status $proc > /dev/null 2>&1; then
+ restart
+ fi
+ ;;
+ status)
+- status $prog
++ status $proc
+ rtrn=$?
+ ;;
+ stop)
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index 23da0a2..0693ddb 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -9,6 +9,7 @@ SRC_URI = " \
file://fix-lcrso-linkage.patch \
file://build-cleanup-configure-ac.patch \
file://openais-fix-bash.patch \
+ file://openais-fix-init-script.patch \
file://openais.service \
"
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [meta-cgl][PATCH 3/5] openais: fix saTmrTimerReschedule test error
2017-05-26 8:46 [meta-cgl][PATCH 0/5] openais: add systemd support and several fixes jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 1/5] openais: add systemd support jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 2/5] openais: correct the use of proc name in init script jackie.huang
@ 2017-05-26 8:46 ` jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 4/5] openais: fix corosync not quit jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 5/5] openais: remove cleanup entry from openais jackie.huang
4 siblings, 0 replies; 6+ messages in thread
From: jackie.huang @ 2017-05-26 8:46 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
* If req_lib_tmr_timerreschedule->timer_attributes.type is
SA_TIME_ABSOLUTE, an absolute time value must be higher
than the current absolute time.According to the type, we
will compare the current time with an absolute time. If
the type is SA_TIME_ABSOLUTE, we will compare. Or else,
we do nothing;
* For single-event timers, timerPeriodDuration = 0 is required.
Note that saTmrTimerReschedule() cannot be used to change a
timer from being a single-event timer to a periodic timer or
vice versa. Since the older timerPeriodDuration is 0 in testtmr.c
file, it is a single-event timer. The following reschedule will
change it to a periodic timer. It is not permitted.
Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../openais-saTmrTimerReschedule-test-error.patch | 50 ++++++++++++++++++++++
.../recipes-cgl/openais/openais_1.1.4.bb | 1 +
2 files changed, 51 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch b/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
new file mode 100644
index 0000000..6806fba
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais-saTmrTimerReschedule-test-error.patch
@@ -0,0 +1,50 @@
+commit 379eb121110d22131408cedf2f200165d142852c
+Author: yanjun.zhu <yanjun.zhu@windriver.com>
+Date: Fri Mar 1 12:25:33 2013 +0800
+
+ openais: fix saTmrTimerReschedule test error
+
+ * If req_lib_tmr_timerreschedule->timer_attributes.type is
+ SA_TIME_ABSOLUTE, an absolute time value must be higher
+ than the current absolute time.According to the type, we
+ will compare the current time with an absolute time. If
+ the type is SA_TIME_ABSOLUTE, we will compare. Or else,
+ we do nothing;
+ * For single-event timers, timerPeriodDuration = 0 is required.
+ Note that saTmrTimerReschedule() cannot be used to change a
+ timer from being a single-event timer to a periodic timer or
+ vice versa. Since the older timerPeriodDuration is 0 in testtmr.c
+ file, it is a single-event timer. The following reschedule will
+ change it to a periodic timer. It is not permitted.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+--
+diff -urpN a/services/tmr.c b/services/tmr.c
+--- a/services/tmr.c
++++ b/services/tmr.c
+@@ -442,7 +442,8 @@ static void message_handler_req_lib_tmr_
+
+ current_time = (SaTimeT)(api->timer_time_get());
+
+- if (current_time > req_lib_tmr_timerreschedule->timer_attributes.initialExpirationTime) {
++ if ((SA_TIME_ABSOLUTE == req_lib_tmr_timerreschedule->timer_attributes.type) &&
++ (current_time > req_lib_tmr_timerreschedule->timer_attributes.initialExpirationTime)) {
+ error = SA_AIS_ERR_INVALID_PARAM;
+ goto error_put;
+ }
+diff -urpN a/test/testtmr.c b/test/testtmr.c
+--- a/test/testtmr.c
++++ b/test/testtmr.c
+@@ -86,8 +86,8 @@ int main (void)
+ SaTmrHandleT handle;
+ SaSelectionObjectT select_obj;
+ SaTmrTimerAttributesT attrs;
+- SaTmrTimerAttributesT attrs_a = { SA_TIME_DURATION, TMR_30_SECONDS, 0 };
+- SaTmrTimerAttributesT attrs_b = { SA_TIME_DURATION, TMR_30_SECONDS, 0 };
++ SaTmrTimerAttributesT attrs_a = { SA_TIME_DURATION, TMR_30_SECONDS, TMR_30_SECONDS };
++ SaTmrTimerAttributesT attrs_b = { SA_TIME_DURATION, TMR_30_SECONDS, TMR_30_SECONDS };
+ SaTmrTimerAttributesT new_attrs_a = { SA_TIME_DURATION, TMR_10_SECONDS, TMR_10_SECONDS };
+ SaTmrTimerAttributesT new_attrs_b = { SA_TIME_DURATION, TMR_20_SECONDS, TMR_20_SECONDS };
+ SaTmrTimerIdT id_a;
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index 0693ddb..d54b22f 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -10,6 +10,7 @@ SRC_URI = " \
file://build-cleanup-configure-ac.patch \
file://openais-fix-bash.patch \
file://openais-fix-init-script.patch \
+ file://openais-saTmrTimerReschedule-test-error.patch \
file://openais.service \
"
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [meta-cgl][PATCH 4/5] openais: fix corosync not quit
2017-05-26 8:46 [meta-cgl][PATCH 0/5] openais: add systemd support and several fixes jackie.huang
` (2 preceding siblings ...)
2017-05-26 8:46 ` [meta-cgl][PATCH 3/5] openais: fix saTmrTimerReschedule test error jackie.huang
@ 2017-05-26 8:46 ` jackie.huang
2017-05-26 8:46 ` [meta-cgl][PATCH 5/5] openais: remove cleanup entry from openais jackie.huang
4 siblings, 0 replies; 6+ messages in thread
From: jackie.huang @ 2017-05-26 8:46 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
On some targets, "/etc/init.d/openais stop" can not make
corosync quit since corosync does not respond to signal TERM.
Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../files/openais-fix-corosync-not-quit.patch | 53 ++++++++++++++++++++++
.../recipes-cgl/openais/openais_1.1.4.bb | 1 +
2 files changed, 54 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais-fix-corosync-not-quit.patch
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais-fix-corosync-not-quit.patch b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-corosync-not-quit.patch
new file mode 100644
index 0000000..f3f7279
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-corosync-not-quit.patch
@@ -0,0 +1,53 @@
+commit e26a778dc3726666f6c15838c16efaca2e98abd6
+Author: yanjun.zhu <yanjun.zhu@windriver.com>
+Date: Wed Mar 13 10:10:03 2013 +0800
+
+ openais: fix corosync not quit
+
+ In fsl-p5040, "/etc/init.d/openais stop" can not make corosync quit since corosync
+ does not respond to signal TERM.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+
+diff -urpN a/init/generic.in b/init/generic.in
+--- a/init/generic.in
++++ b/init/generic.in
+@@ -39,18 +39,6 @@ failure()
+ echo -ne "[FAILED]\r"
+ }
+
+-status()
+-{
+- pid=$(pidof $1 2>/dev/null)
+- rtrn=$?
+- if [ $rtrn -ne 0 ]; then
+- echo "$1 is stopped"
+- else
+- echo "$1 ($proc with pid $pid) is running..."
+- fi
+- return $rtrn
+-}
+-
+ # rpm based distros
+ if [ -d @SYSCONFDIR@/sysconfig ]; then
+ [ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
+@@ -98,16 +86,10 @@ stop()
+ ! status $proc > /dev/null 2>&1 && return
+
+ echo -n "Signaling $desc ($prog) to terminate: "
+- kill -TERM $(pidof $proc) > /dev/null 2>&1
++ echo -n "Please stop corosync using /etc/init.d/corosync-daemon stop"
+ success
+ echo
+
+- echo -n "Waiting for $prog services to unload:"
+- while status $proc > /dev/null 2>&1; do
+- sleep 1
+- echo -n "."
+- done
+-
+ rm -f $LOCK_FILE
+ rm -f @LOCALSTATEDIR@/run/$prog.pid
+ success
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index d54b22f..9cc750a 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -11,6 +11,7 @@ SRC_URI = " \
file://openais-fix-bash.patch \
file://openais-fix-init-script.patch \
file://openais-saTmrTimerReschedule-test-error.patch \
+ file://openais-fix-corosync-not-quit.patch \
file://openais.service \
"
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [meta-cgl][PATCH 5/5] openais: remove cleanup entry from openais
2017-05-26 8:46 [meta-cgl][PATCH 0/5] openais: add systemd support and several fixes jackie.huang
` (3 preceding siblings ...)
2017-05-26 8:46 ` [meta-cgl][PATCH 4/5] openais: fix corosync not quit jackie.huang
@ 2017-05-26 8:46 ` jackie.huang
4 siblings, 0 replies; 6+ messages in thread
From: jackie.huang @ 2017-05-26 8:46 UTC (permalink / raw)
To: yocto
From: Jackie Huang <jackie.huang@windriver.com>
message_handler_req_exec_lck_resourceclose is to remove cleanup
entry from corosync. Now this job is done by pacemaker. So remove
this feature from openais.
Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../files/openais-fix-resource-cleanup-entry.patch | 37 ++++++++++++++++++++++
.../recipes-cgl/openais/openais_1.1.4.bb | 1 +
2 files changed, 38 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/openais/files/openais-fix-resource-cleanup-entry.patch
diff --git a/meta-cgl-common/recipes-cgl/openais/files/openais-fix-resource-cleanup-entry.patch b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-resource-cleanup-entry.patch
new file mode 100644
index 0000000..55313ce
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/openais/files/openais-fix-resource-cleanup-entry.patch
@@ -0,0 +1,37 @@
+commit f70bea251f21a8bd646e59b34e6f74f6ee3fe29b
+Author: yanjun.zhu <yanjun.zhu@windriver.com>
+Date: Tue Mar 19 12:23:55 2013 +0800
+
+ openais: remove cleanup entry from openais
+
+ message_handler_req_exec_lck_resourceclose is to remove cleanup
+ entry from corosync. Now this job is done by pacemaker. So remove
+ this feature from openais.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+
+diff -urpN a/services/lck.c b/services/lck.c
+--- a/services/lck.c
++++ b/services/lck.c
+@@ -2304,17 +2304,9 @@ error_exit:
+
+ if (error == SA_AIS_OK) {
+ /*
+- * Remove the cleanup entry for this resource.
++ * cleanup entry for this resource can not be removed.
++ * This will be done by pacemaker.
+ */
+- cleanup = lck_resource_cleanup_find (
+- req_exec_lck_resourceclose->source.conn,
+- &req_exec_lck_resourceclose->resource_name);
+-
+- if (cleanup != NULL) {
+- list_del (&cleanup->cleanup_list);
+- free (cleanup);
+- }
+-
+ hdb_handle_put (&resource_hdb, req_exec_lck_resourceclose->resource_id);
+ hdb_handle_destroy (&resource_hdb, req_exec_lck_resourceclose->resource_id);
+ }
diff --git a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
index 9cc750a..cdf1454 100644
--- a/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
+++ b/meta-cgl-common/recipes-cgl/openais/openais_1.1.4.bb
@@ -12,6 +12,7 @@ SRC_URI = " \
file://openais-fix-init-script.patch \
file://openais-saTmrTimerReschedule-test-error.patch \
file://openais-fix-corosync-not-quit.patch \
+ file://openais-fix-resource-cleanup-entry.patch \
file://openais.service \
"
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread