blob: fb8f8320616d4899f716b000f1dae621eef6ecba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/bin/bash
source /usr/local/etc/library.sh # sets PHPVER
set -e
[[ "$1" == "stop" ]] && {
echo "Stopping apache"
apachectl graceful-stop
echo "Stopping PHP-fpm"
pkill -f php-fpm
echo "Stopping mariaDB"
mysqladmin -u root shutdown
echo "LAMP cleanup complete"
exit 0
}
# MOVE CONFIGS TO PERSISTENT VOLUME
persistent_cfg /etc/apache2
echo "Starting PHP-fpm"
php-fpm${PHPVER}
echo "Starting Apache"
/usr/sbin/apache2ctl start
# adjust the dbdir to the persistent storage
sed -i "s|^datadir.*|datadir = /data/database|" /etc/mysql/mariadb.conf.d/90-ncp.cnf
# start
echo "Starting mariaDB"
mysqld &
# wait for mariadb
while :; do
[[ -S /var/run/mysqld/mysqld.sock ]] && break
sleep 0.5
done
exit 0
|