-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The only signal understood by the program is SIGINT, via the convenient ctrl_c handler by tokio. Systemd sends SIGTERM/SIGKILL by default, so let's override that to give the application a chance to clean up. The real solution is supporting SIGTERM directly.
- Loading branch information
Showing
4 changed files
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,26 +82,18 @@ Running as a service | |
-------------------- | ||
|
||
The deb package ships with a systemd config file. | ||
To use it, choose a unique name for the service (e.g. `foo`), | ||
To use it, choose a unique name for the service (e.g. `minikube`), | ||
and make sure your API token is exported: | ||
|
||
``` | ||
sudo mkdir -p /etc/systemd/system/[email protected]/ | ||
printf '[Service]\nEnvironment="DIGITALOCEAN_API_TOKEN=%s"\n' "$DIGITALOCEAN_API_TOKEN" > /etc/systemd/system/[email protected]/override.conf | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart innisfree@foo | ||
sudo journalctl -af -u innisfree@foo | ||
``` | ||
|
||
You can also override more settings: | ||
|
||
``` | ||
cat /etc/systemd/system/innisfree\@minikube.service.d/override.conf | ||
[Service] | ||
Environment="DIGITALOCEAN_API_TOKEN=<REDACTED>" | ||
# Override any settings from the shipped service | ||
User=conorsch | ||
ExecStart= | ||
ExecStart=/bin/bash -c "innisfree up --floating-ip 1.2.3.4 --dest-ip $(su conorsch -c 'minikube ip') -p 443/TCP --name k8s" | ||
ExecStart=/bin/bash -c "innisfree up --floating-ip 1.2.3.4 --dest-ip $(minikube ip) -p 443/TCP --name k8s" | ||
``` | ||
|
||
The above will proxy a connection to a local minikube installation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters