lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.67k stars 2.07k forks source link

Feature request: stop without unlocking the wallet #1028

Closed bitonic-cjp closed 1 month ago

bitonic-cjp commented 6 years ago

The "stop" command currently requires the wallet to be unlocked. This is inconvenient when using scripts to start/stop LND, when those scripts don't have knowledge of the wallet passphrase and can't assume the wallet will always be unlocked.

I'd say that a script that has access to the admin macaroon is already sufficiently authorized to stop LND. Why require the wallet passphrase to stop the software?

Maybe this is not so important if LND does a proper shutdown when it receives SIGTERM. In that case, please document this behavior or point to the documentation.

aakselrod commented 6 years ago

Unfortunately, the macaroon database is encrypted with the same password as the wallet; this makes it impossible to check a macaroon until the wallet is also unlocked.

We should resolve this by making lnd shut down correctly upon receiving SIGTERM, and documenting that this is the correct way to shut it down if it's running in the background and the wallet is not unlocked.

MDrollette commented 5 years ago

Can this be closed now that SIGTERM is handled?

wpaulino commented 5 years ago

Not yet, I believe the StopDaemon RPC would also need to be added to the WalletUnlocker service.

saubyk commented 1 month ago

closing this issue, as unsure about the need for this feature. If LND is locked, it can be killed without any adverse impact, which the automated scripts should be able to handle in their logic.