-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add manual steps describing how to check launcher behavior regarding …
…POSIX signals
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Cardano.Launcher.POSIX | ||
|
||
## Goal | ||
|
||
By default, the Haskell runtime and the `process` library we use to spawn new | ||
processes in the launcher don't catch `SIGTERM` signals on a unix system. This | ||
means that if we kill the launcher process, the sub-processes it has spawned | ||
will endure. | ||
|
||
What follows are steps which explains how to test that `SIGINT` and `SIGTERM` | ||
signals are correctly handled on a unix system. | ||
|
||
## Steps | ||
|
||
### `SIGINT` | ||
|
||
- Start the launcher using `stack exec -- cardano-wallet-launcher` | ||
- In another terminal, run `ps -ef | grep cardano`, there should be three | ||
processes running (the launcher, the wallet and the underlying chain | ||
producer) | ||
``` | ||
$ ps -ef | grep cardano | ||
10983 4904 0 09:42 pts/1 00:00:00 /home/user/Documents/IOHK/cardano-wallet/.stack-work/install/x86_64-linux/lts-13.8/8.6.3/bin/cardano-wallet-launcher | ||
11003 10983 75 09:42 pts/1 00:03:30 cardano-http-bridge start --port 8080 | ||
11071 10983 58 09:42 pts/1 00:02:41 cardano-wallet-server --wallet-server-port 8090 --http-bridge-port 8080 --network mainnet | ||
``` | ||
|
||
- Send a `SIGINT` signal using by pressing `CTRL-C` in the first terminal | ||
- Run `ps -ef | grep cardano`, there's no more process running: the launcher, | ||
the wallet and the chain producer have all stopped. | ||
|
||
### `SIGTERM` | ||
|
||
- Start the launcher in background using `stack exec -- cardano-wallet-launcher &` | ||
- Run `ps -ef | grep cardano` and lookup the `pid` of the launcher process (and | ||
control that there are indeed three processes running: the launcher, the | ||
wallet and the chain producer) | ||
``` | ||
$ ps -ef | grep cardano | ||
10983 4904 0 09:42 pts/1 00:00:00 /home/user/Documents/IOHK/cardano-wallet/.stack-work/install/x86_64-linux/lts-13.8/8.6.3/bin/cardano-wallet-launcher | ||
11003 10983 75 09:42 pts/1 00:03:30 cardano-http-bridge start --port 8080 | ||
11071 10983 58 09:42 pts/1 00:02:41 cardano-wallet-server --wallet-server-port 8090 --http-bridge-port 8080 --network mainnet | ||
``` | ||
- Send a `SIGTERM` signal to this pid using `kill <pid>` | ||
- Run `ps -ef | grep cardano`, there's no more process running: the launcher, | ||
the wallet and the chain producer have all stopped. |