2 # ================================================================================
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
17 # Set up persistent storage for Cloudify Manager's state data
19 PDIRS="/var/lib/pgsql/9.5/data /opt/manager/resources /opt/mgmtworker/env/plugins /opt/mgmtworker/work/deployments"
26 # the persistent mount point exists
27 if [ -z "$(ls -A $PSTORE)" ]
29 # there's nothing in the persistent store yet
30 # copy in the data from the container file system
34 mkdir -p "${PSTORE}$p"
35 cp -rp "$d" "${PSTORE}$p"
38 # at this point, there is persistent storage possibly from a previous startup
39 # set up links from internal file system to persistent storage
44 mv $d $d-initial # move directory so we can create symlink
46 ln -sf "$PSTORE/$d" "$(dirname $d)"
49 echo "No persistent storage available"
52 # start background script that updates CM password and uploads plugins
53 /scripts/init-cloudify.sh &
54 # start up init, which brings up CM and supporting software
55 exec /sbin/init --log-target=journal 3>&1