-
Notifications
You must be signed in to change notification settings - Fork 667
Fix guestagent service file #3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think interpolating the values in the script directly, and having to escape all normal '$' signsis maintenance-friendly. You could define the values first with an interpolated block, and then append the rest of the script verbatim: cat >/etc/init.d/lima-guestagent <<EOF
#!/sbin/openrc-run
LIMA_CIDATA_GUEST_INSTALL_PREFIX=$LIMA_CIDATA_GUEST_INSTALL_PREFIX
...
EOF
cat >>/etc/init.d/lima-guestagent <<'EOF'
supervisor=supervise-daemon
log_file="${log_file:-/var/log/${RC_SVCNAME}.log}"
...
EOF But then you can just as well write the values to |
dc94184
to
5eb93ff
Compare
Got it! |
a65f2fc
to
af42d2e
Compare
There is one problem with that though: So in In shell this can be a syntax error (or even run an unintended command), so the string needs to be quoted using the shell quoting rules. Now, it looks like we don't have any crazy values in there, that can in turn contain quotes etc, so simply surrounding the value with double-quotes should be good enough. The only value that I found creating problems was the user comment field (full name):
And it is just noise, but I still think we should do this properly: lima-alpine:~# rc-service lima-guestagent stop
/usr/libexec/rc/sh/openrc-run.sh: /etc/init.d/../conf.d/lima-guestagent: line 5: Dubois: not found
* Stopping lima-guestagent ... [ ok ]
lima-alpine:~# rc-service lima-guestagent start
/usr/libexec/rc/sh/openrc-run.sh: /etc/init.d/../conf.d/lima-guestagent: line 5: Dubois: not found
* Starting lima-guestagent ... [ ok ] |
Appreciate the clarification. I will make the changes. |
af42d2e
to
7c19693
Compare
Co-authored-by: Jan Dubois <[email protected]> Signed-off-by: Songpon Srisawai <[email protected]>
d31ceb9
to
5ce662d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Fix #3467
I think that the service file is supposed to be created with variables during the boot process.
I’ve fixed the heredoc to print LIMA_CIDATA_* in the boot script.