Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-virt / recipes-extended / ceph / ceph-14.1.0 / 0001-ceph-rebase-on-stx.3.0-and-warrior.patch
1 From 3763a20314ec2b80ec9d8525a1d3867b3c731266 Mon Sep 17 00:00:00 2001
2 From: "Sar Ashki, Babak" <Babak.SarAshki@windriver.com>
3 Date: Sat, 22 Feb 2020 04:48:04 -0800
4 Subject: [PATCH] ceph rebase on stx.3.0 and warrior
5
6 From 03340eaf0004e3cc8e3f8991ea96a46757d92830 Mon Sep 17 00:00:00 2001
7 From: Don Penney <don.penney@windriver.com>
8 Date: Sat, 26 Jan 2019 13:34:55 -0500
9 Subject: [PATCH] Add hooks for orderly shutdown on controller
10
11 Hook the ceph init script to add systemd overrides to define
12 an orderly shutdown for StarlingX controllers.
13 ---
14  src/init-ceph.in | 32 ++++++++++++++++++++++++++++++++
15  1 file changed, 32 insertions(+)
16
17 diff --git a/src/init-ceph.in b/src/init-ceph.in
18 index 1843710..a31b900 100755
19 --- a/src/init-ceph.in
20 +++ b/src/init-ceph.in
21 @@ -434,6 +434,38 @@ for name in $what; do
22                 continue
23             fi
24  
25 +            . /etc/platform/platform.conf
26 +            if [ "${nodetype}" = "controller" ]; then
27 +                # StarlingX: Hook the transient services launched by systemd-run
28 +                # to allow for proper cleanup and orderly shutdown
29 +
30 +                # Set nullglob so wildcards will return empty string if no match
31 +                shopt -s nullglob
32 +
33 +                OSD_SERVICES=$(for svc in /run/systemd/system/ceph-osd*.service; do basename $svc; done | xargs echo)
34 +                for d in /run/systemd/system/ceph-osd*.d; do
35 +                    cat <<EOF > $d/starlingx-overrides.conf
36 +[Unit]
37 +Before=docker.service
38 +After=sm-shutdown.service
39 +
40 +EOF
41 +                done
42 +
43 +                for d in /run/systemd/system/ceph-mon*.d; do
44 +                    cat <<EOF > $d/starlingx-overrides.conf
45 +[Unit]
46 +Before=docker.service
47 +After=sm-shutdown.service ${OSD_SERVICES}
48 +
49 +EOF
50 +                done
51 +
52 +                shopt -u nullglob
53 +
54 +                systemctl daemon-reload
55 +            fi
56 +
57             [ -n "$post_start" ] && do_cmd "$post_start"
58             [ -n "$lockfile" ] && [ "$?" -eq 0 ] && touch $lockfile
59             ;;
60 -- 
61 2.23.0
62