Skip to content

Commit a1f1b22

Browse files
committed
cidata: alpine: move guestagent installer from 10-alpine-pre.sh to 25-guestagent-base.sh
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 3a0bb91 commit a1f1b22

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/10-alpine-prep.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,6 @@ usermod -p '*' "${LIMA_CIDATA_USER}"
2626
sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/g' /etc/ssh/sshd_config
2727
rc-service sshd reload
2828

29-
# Create directory for the lima-guestagent socket (normally done by systemd)
30-
mkdir -p /run/user/${LIMA_CIDATA_UID}
31-
chown "${LIMA_CIDATA_USER}" /run/user/${LIMA_CIDATA_UID}
32-
chmod 700 /run/user/${LIMA_CIDATA_UID}
33-
34-
# Install the openrc lima-guestagent service script
35-
cat >/etc/init.d/lima-guestagent <<'EOF'
36-
#!/sbin/openrc-run
37-
supervisor=supervise-daemon
38-
39-
name="lima-guestagent"
40-
description="Forward ports to the lima-hostagent"
41-
42-
export XDG_RUNTIME_DIR="/run/user/${LIMA_CIDATA_UID}"
43-
command=/usr/local/bin/lima-guestagent
44-
command_args="daemon"
45-
command_background=true
46-
command_user="${LIMA_CIDATA_USER}:${LIMA_CIDATA_USER}"
47-
pidfile="${XDG_RUNTIME_DIR}/lima-guestagent.pid"
48-
EOF
49-
chmod 755 /etc/init.d/lima-guestagent
50-
5129
# mount /sys/fs/cgroup
5230
rc-service cgroups start
5331

pkg/cidata/cidata.TEMPLATE.d/boot/25-guestagent-base.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,27 @@ install -m 755 "${LIMA_CIDATA_MNT}"/lima-guestagent /usr/local/bin/lima-guestage
1515

1616
# Launch the guestagent service
1717
if [ -f /etc/alpine-release ]; then
18+
# Create directory for the lima-guestagent socket (normally done by systemd)
19+
mkdir -p /run/user/${LIMA_CIDATA_UID}
20+
chown "${LIMA_CIDATA_USER}" /run/user/${LIMA_CIDATA_UID}
21+
chmod 700 /run/user/${LIMA_CIDATA_UID}
22+
# Install the openrc lima-guestagent service script
23+
cat >/etc/init.d/lima-guestagent <<'EOF'
24+
#!/sbin/openrc-run
25+
supervisor=supervise-daemon
26+
27+
name="lima-guestagent"
28+
description="Forward ports to the lima-hostagent"
29+
30+
export XDG_RUNTIME_DIR="/run/user/${LIMA_CIDATA_UID}"
31+
command=/usr/local/bin/lima-guestagent
32+
command_args="daemon"
33+
command_background=true
34+
command_user="${LIMA_CIDATA_USER}:${LIMA_CIDATA_USER}"
35+
pidfile="${XDG_RUNTIME_DIR}/lima-guestagent.pid"
36+
EOF
37+
chmod 755 /etc/init.d/lima-guestagent
38+
1839
rc-update add lima-guestagent default
1940
rc-service lima-guestagent start
2041
else

0 commit comments

Comments
 (0)