lightning-terminal icon indicating copy to clipboard operation
lightning-terminal copied to clipboard

add systemd `Type=notify` support

Open AndySchroder opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. litd doesn't do systemd notify like lnd does (https://github.com/lightningnetwork/lnd/blob/86e7b4e1e02e29117dcebba319b0da98e66a3365/contrib/init/lnd.service#L22) so we don't know when litd is ready to use. With Type=notify, systemctl start litd.service just hangs.

Describe the solution you'd like Be able to use Type=notify in systemd service files.

While you are adding this, it would be good to add an example systemd service file so that people know the best way to launch litd.

Describe alternatives you've considered Type=simple works, but we don't have consistency with lnd and we don't know when litd is fully up and running for dependent services to use.

Additional context Would like systemd service files for all lightning labs products to be nearly identical.

I think lnd is implementing this here: https://github.com/lightningnetwork/lnd/blob/86e7b4e1e02e29117dcebba319b0da98e66a3365/signal/signal.go#L25 .

See also, https://manpages.debian.org/bookworm/systemd/systemd.service.5.en.html#OPTIONS .

AndySchroder avatar Jul 05 '23 19:07 AndySchroder

Seems reasonable. The right folks to think through this fully are likely OOO for the remainder of the week. But, general ack of the concept from me. I'll circle up with them next week and think through how we could move forward here. Just responding so you know we're looking at it and on it.

levmi avatar Jul 06 '23 12:07 levmi

good idea!

All we need is a daemon.SdNotify(false, daemon.SdNotifyReady) call once all the subservers are started up.

Some inspiration here: https://github.com/lightningnetwork/lnd/blob/master/signal/signal.go#L28

ellemouton avatar Jul 10 '23 08:07 ellemouton