Skip to content
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

bos command run on startup #9

Open
JMskch opened this issue Feb 8, 2022 · 14 comments
Open

bos command run on startup #9

JMskch opened this issue Feb 8, 2022 · 14 comments
Labels
enhancement New feature or request

Comments

@JMskch
Copy link

JMskch commented Feb 8, 2022

Hello,

is there a way to run some command on the startup of the docker? e.g.

bos telegram --connect 1726156086 1> /tmp/bos.log 2>&1 & disown

to connect telegram bos and run it in the background? It would be best if the upgrade did not override this setting.

Thanks in advance.

@JMskch
Copy link
Author

JMskch commented Feb 8, 2022

I also found that even the telegram bot API key did not remain saved after node reboot. Can this be saved in any way or it must be set every reboot?

@AaronDewes
Copy link
Contributor

I'm doing it this way:

tmux

This starts a tmux session.

You can run any command from there and when you run tmux detach, the command stays running in a shell you can connect to at any time by tmux attach

@JMskch
Copy link
Author

JMskch commented Feb 9, 2022

@AaronDewes Does tmux solve previously stated problems?
-node reboot --> automatic startup telegram connection(API + connect code) within lightning shell
-lightning shell upgrade

@ibz
Copy link
Owner

ibz commented Feb 9, 2022

Hey @JMskch. Very good point. For now you could do it by editing /start.sh, which is the script that gets run when the container starts. That will of course be overriden by updates though... I'll add a way to make it stay (by having start.sh call another script that stays in your data/ directory). But until the next update, this is the way to go.

PS: to edit start.sh you need to get into the container as root: docker exec -u root -it <container_id> bash

@ibz ibz added the enhancement New feature or request label Feb 9, 2022
@ibz
Copy link
Owner

ibz commented Feb 9, 2022

Sorry @JMskch, I said something stupid. There is no start.sh in Lightning Shell, only in usocial. I am working on 2 Umbrel apps in parallel and sometimes confuse the two. :)

So no, you can't do it for now. Unless you rebuild the Docker image yourself.

@ibz
Copy link
Owner

ibz commented Feb 9, 2022

Sorry @JMskch, I said something stupid. There is no start.sh in Lightning Shell, only in usocial. I am working on 2 Umbrel apps in parallel and sometimes confuse the two. :)

So no, you can't do it for now. Unless you rebuild the Docker image yourself.

@ibz
Copy link
Owner

ibz commented Feb 10, 2022

@JMskch Added this feature in v0.1.7 https://lightningshell.app/history/#v0.1.7

Either wait for the official Umbrel update, or upgrade Lightning Shell yourself to v0.1.7.

@ibz ibz closed this as completed Feb 10, 2022
@JMskch
Copy link
Author

JMskch commented Feb 10, 2022

That was fast, many thanks.

@JMskch
Copy link
Author

JMskch commented Mar 2, 2022

Hi @ibz, how to run commands for connecting bos telegram? when I use cli commands, which normally works like(dummy token and key)
printf '%s\n' "9823545168:HHUJHhP8Io8P95495LPb656ra7Q8Jc" | timeout -s SIGINT 20s bos telegram --reset-api-key
bos telegram --connect 0540461554 1> /tmp/bos.log 2>&1 & disown

I tried many different commands...things like changing shebang and so on, but I cannot make it work.

on_start.sh seems executing...tried with basic command echo to file, which worked on docker restart.

@ibz
Copy link
Owner

ibz commented Mar 6, 2022

I haven't tried running the telegram bot myself, so I can't answer this, but I will reopen this issue and hopefully somebody will reply.

@ibz ibz reopened this Mar 6, 2022
@jonathanalevi
Copy link

I'm also struggling with it, actually. Did you end up figuring it out @JMskch ?

@JMskch
Copy link
Author

JMskch commented Jun 9, 2022

@jonathanalevi unfortunately not.

@decentropy
Copy link

decentropy commented Jul 10, 2022

To clarify ... the on_start.sh script does not resolve this issue. The problem is, BOS normal behavior is to retain the API key between reboots. For some reason, the LightningShell container is not remembering the API key after reboot. This is a problem, because BOS initiates API key through an interactive prompt which cannot be scripted (i.e. on_start.sh won't work).

If this issue gets resolved (BOS remembers API key after reboot), then BOS connection could be automated with on_start.sh. BOS telegram bot is probably one of the most popular things to run on an LND node. (It's the only way I know of, to be notified of node activity). It would be really sweet if this worked on LightningShell, because it would save lots of Umbrel users the hassle of installing BOS manually.

That said... sorry, I can't say what cause might be.
Meanwhile - the workaround would be to open LightningShell and manually step through "bos telegram" after every reboot.

@sz3k
Copy link

sz3k commented Sep 4, 2022

I have now once again run into this issue - ln-shell forgets the telegram API key for BoS on reboot.

@ibz any ideas on why this could be, or strategies we could use for a fix or workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants