-
Notifications
You must be signed in to change notification settings - Fork 712
Minimize effects caused by restarting guestagent #4217
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
base: master
Are you sure you want to change the base?
Minimize effects caused by restarting guestagent #4217
Conversation
Short: "Install a systemd unit (user)", | ||
RunE: installSystemdAction, | ||
} | ||
installSystemdCommand.Flags().Bool("guestagent-updated", false, "Indicate that the guest agent has been updated") |
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.
Alternatively you can just compare mtime of os.Executable
to detect whether it was updated
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.
I wanted to use the judgment result of "update guestagent" made in the boot script.
I don't want to increase the judgment logic of the update.
|
||
[Service] | ||
ExecStart={{.Binary}} daemon {{.Args}} | ||
ExecStart={{.Binary}} daemon {{.Args}} --runtime-dir="%t/%N" |
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.
?
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.
"%t/%N"
will be expanded to "/run/lima-guestagent"
by systemd.
Short: "Run the daemon", | ||
RunE: daemonAction, | ||
} | ||
daemonCommand.Flags().String("runtime-dir", "/run/lima-guestagent", "Directory to store runtime state") |
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.
Why does this need to be customizable?
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.
for environment that does not want to use "/run/lima-guestagent"?
I don't know if there is such an environment. However, I can't think of a reason why it's better to hardcode this.
d621e82
to
683bf84
Compare
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/bin/bash |
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.
Does this work with Alpine?
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.
It works with both "template:alpine" and "template:alpine-iso", and has already been used in other boot scripts.
return &ticker, nil | ||
} | ||
|
||
var _ Ticker = (*ebpfTicker)(nil) |
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.
?
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.
Let Go check whether ebpfTicker
fits the type Ticker interface
.
By doing this, VSCode's Go extension recognizes the relationship between these types and makes it more convenient.
t1, t2 Ticker | ||
} | ||
|
||
var _ Ticker = (*compoundTicker)(nil) |
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.
?
… config have no changes. Signed-off-by: Norio Nomura <[email protected]>
…on stop/start `eventState` is saved at `/run/lima-guestagent/event-state.json`. The saved `eventState` is expected to be removed on OS restart. Signed-off-by: Norio Nomura <[email protected]>
683bf84
to
5008118
Compare
lima-guestagent
: Handle SIGTERM, support save/restoreeventState
on stop/startFixes #4216