Skip to content

Commit a5787df

Browse files
committed
cidata: embed lima-guestagent.openrc in 10-alpine-prep.sh
Signed-off-by: Akihiro Suda <[email protected]>
1 parent b55824c commit a5787df

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@ chown "{{.User}}" /run/user/{{.UID}}
3232
chmod 700 /run/user/{{.UID}}
3333

3434
# Install the openrc lima-guestagent service script
35-
mv /var/lib/lima-guestagent/lima-guestagent.openrc /etc/init.d/lima-guestagent
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/{{.UID}}"
43+
command=/usr/local/bin/lima-guestagent
44+
command_args="daemon"
45+
command_background=true
46+
command_user="{{.User}}:{{.User}}"
47+
pidfile="${XDG_RUNTIME_DIR}/lima-guestagent.pid"
48+
EOF
49+
chmod 755 /etc/init.d/lima-guestagent
3650

3751
# mount /sys/fs/cgroup
3852
rc-service cgroups start

pkg/cidata/cidata.TEMPLATE.d/user-data

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,6 @@ write_files:
3838
owner: root:root
3939
path: /var/lib/cloud/scripts/per-boot/00-lima.boot.sh
4040
permissions: '0755'
41-
# TODO: embed lima-guestagent.openrc in 10-alpine-prep.boot.sh
42-
- content: |
43-
#!/sbin/openrc-run
44-
supervisor=supervise-daemon
45-
46-
name="lima-guestagent"
47-
description="Forward ports to the lima-hostagent"
48-
49-
export XDG_RUNTIME_DIR="/run/user/{{.UID}}"
50-
command=/usr/local/bin/lima-guestagent
51-
command_args="daemon"
52-
command_background=true
53-
command_user="{{.User}}:{{.User}}"
54-
pidfile="${XDG_RUNTIME_DIR}/lima-guestagent.pid"
55-
owner: root:root
56-
path: /var/lib/lima-guestagent/lima-guestagent.openrc
57-
permissions: '0755'
5841
{{- if .Provision}}
5942
# TODO: move Provision scripts to ISO
6043
- content: |

0 commit comments

Comments
 (0)