-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathinit_container.sh
More file actions
49 lines (40 loc) · 1.18 KB
/
init_container.sh
File metadata and controls
49 lines (40 loc) · 1.18 KB
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
41
42
43
44
45
46
47
48
49
#!/bin/sh
cat >/etc/motd <<EOL
_____
/ _ \ __________ _________ ____
/ /_\ \\___ / | \_ __ \_/ __ \
/ | \/ /| | /| | \/\ ___/
\____|__ /_____ \____/ |__| \___ >
\/ \/ \/
A P P S E R V I C E O N L I N U X
Documentation: http://aka.ms/webapp-linux
PHP quickstart: https://aka.ms/php-qs
EOL
cat /etc/motd
# Get environment variables to show up in SSH session
eval $(printenv | sed -n "s/^\([^=]\+\)=\(.*\)$/export \1=\2/p" | sed 's/"/\\\"/g' | sed '/=/s//="/' | sed 's/$/"/' >> /etc/profile)
# start after openrc
(
sleep 5
echo "Starting SSH ..."
rc-update add sshd
rc-service sshd restart
) &
(
sleep 5
# make the socket
mkdir -p /var/run/php && \
touch /var/run/php/php-fpm.sock && \
chown www-data:www-data /var/run/php/php-fpm.sock && \
chmod 660 /var/run/php/php-fpm.sock
echo "Starting php-fpm ..."
rc-service php-fpm restart
) &
(
sleep 5
echo "Starting Nginx ..."
rc-service nginx restart
) &
# openrc needs to start as PID 1
echo "Starting openrc ..."
exec /sbin/init