-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
how does the daemon work #255
Comments
I am adding listening socket to client right now. Probably it will be done in a couple of days. Right now client only can work with commands from stdin. Also you can write lua script, that will check some file peridically and make actions depending of file contents. |
Try -P option for opening listening socket. It is untested though. |
I tried to run the daemon mode as well with the -P option, it says user telegramd cannot be found. |
Telegram-cli tries to setuid if is run as root. If there is no -u option it tries to use user telegramd. |
thanks for the fast reply, not sure yet how to use the daemon but i supose i should look into linux sockets? |
I've written small page about how I run it as daemon. Not sure if it is suitable for you, but at least you can look there https://github.com/vysheng/tg/wiki/Running-as-daemon |
Hi, Alternatively, I am using Screen using the following steps: yum install screen upon successful installation, type cmd screen -S Telegram change_user_group: can't find the user telegramd to switch to The prompt '>' is only appears after Telegram registration. You can verify your screen is running by screen -ls Test sending a message to your screen using screen -S Telegram -X stuff "msg " Good luck. |
It is useful to also note that if you use screen you can use the logfile and logflush commands to write all contents of the screen session to a log file. I use this to run an irc telegram bot. The logflush is quite happy running at a 0 settings which is "realtime logging". I then parse out any sent/returned messages via regex. Works extremely well! |
Just noticed since the latest commits the log file is dumping a lot of > in the file every time the screen session flushes. It didn't used to do this with the code I had been using a few months ago. Has something been changed? Is the timed lua scripts causing this? It suggests something is firing every few seconds @vysheng any ideas? |
I'll see. Probably prompt update. You can use '-R' key that disables readline. It would alse diable promt |
@vysheng thanks for getting back to me, I'll give the -R key a test tonight. I'm currently running from an old git version which seems to work fine back in April (prior to the big lua changes) but it would be good to use the latest git version with the new features also. |
@vysheng Thanks for the fix the -R key solves the issue for me perfectly. Do you have any examples (maybe in the wiki) of sending messages via telnet or other means to the port and receiving messages back? If I can complete this last bit I can completely ditch my screen logging option 👍 |
It is just text protocol. You can use telnet to try. Commands are just the same as from terminal. |
Run telegram-cli as daemon: Command Line to access <<< or >>> unread |
\r is not necessary. |
can i run the daemon and for example send and receive messages through a script?
The text was updated successfully, but these errors were encountered: