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

letheand restart loop with systemd letheand.service #61

Open
ronnylov opened this issue Feb 23, 2019 · 7 comments
Open

letheand restart loop with systemd letheand.service #61

ronnylov opened this issue Feb 23, 2019 · 7 comments

Comments

@ronnylov
Copy link

ronnylov commented Feb 23, 2019

sudo journalctl -xe

Feb 23 13:22:34 ca02 letheand[25132]: 2019-02-23 13:22:34.807 7f030a850b80 INFO global src/daemon/p2p.h:63 Initializing p2p server...
Feb 23 13:22:38 ca02 kernel: [UFW BLOCK] IN=enp1s0 OUT= MAC=2c:56:dc:73:3f:40:00:ff:ff:ff:ff:fe:08:00 SRC=194.61.24.149 DST=158.69.123.115 LEN=40 TOS=0x00 PREC=0x00 TTL=248 ID=13875 PROTO=TCP SPT=50940 DPT=8107
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global src/daemon/p2p.h:68 P2p server initialized OK
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global src/daemon/rpc.h:58 Initializing core rpc server...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global contrib/epee/include/net/http_server_impl_base.h:70 Binding on 127.0.0.1:48782
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global src/daemon/rpc.h:63 Core rpc server initialized OK on port: 48782
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global src/daemon/core.h:73 Initializing core...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.812 7f030a850b80 INFO global src/cryptonote_core/cryptonote_core.cpp:321 Loading blockchain from folder /home/le
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.836 7f030a850b80 INFO global src/cryptonote_core/cryptonote_core.cpp:419 Loading checkpoints
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.836 7f030a850b80 INFO global src/daemon/core.h:78 Core initialized OK
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.836 7f030a850b80 INFO global src/daemon/rpc.h:68 Starting core rpc server...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/rpc.h:73 Core rpc server started ok
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/p2p.h:78 Starting p2p net loop...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/p2p.h:80 p2p net loop stopped
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/rpc.h:78 Stopping core rpc server...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/daemon.cpp:145 Node stopped.
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/rpc.h:90 Deinitializing rpc server...
Feb 23 13:22:38 ca02 letheand[25132]: 2019-02-23 13:22:38.837 [SRV_MAIN] INFO global src/daemon/p2p.h:90 Deinitializing p2p...
Feb 23 13:22:39 ca02 letheand[25132]: 2019-02-23 13:22:39.838 [SRV_MAIN] INFO global src/daemon/core.h:89 Deinitializing core...
Feb 23 13:22:39 ca02 letheand[25132]: 2019-02-23 13:22:39.839 [SRV_MAIN] INFO global src/daemon/protocol.h:77 Stopping cryptonote protocol...
Feb 23 13:22:39 ca02 letheand[25132]: 2019-02-23 13:22:39.839 [SRV_MAIN] INFO global src/daemon/protocol.h:81 Cryptonote protocol stopped successfully
Feb 23 13:22:39 ca02 systemd[1]: letheand.service: Main process exited, code=exited, status=1/FAILURE
Feb 23 13:22:39 ca02 systemd[1]: letheand.service: Unit entered failed state.
Feb 23 13:22:39 ca02 systemd[1]: letheand.service: Failed with result 'exit-code'.
Feb 23 13:22:40 ca02 systemd[1]: letheand.service: Service hold-off time over, scheduling restart.
Feb 23 13:22:40 ca02 systemd[1]: Stopped LTHN daemon.
-- Subject: Unit letheand.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- Unit letheand.service has finished shutting down.
Feb 23 13:22:40 ca02 systemd[1]: Started LTHN daemon.
-- Subject: Unit letheand.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- Unit letheand.service has finished starting up.

-- The start-up result is done.
Feb 23 13:22:40 ca02 letheand[25437]: 2019-02-23 13:22:40.056 7f87be9dbb80 INFO global src/daemon/main.cpp:279 Lethean 'Congo' (v3.0.0-release)
Feb 23 13:22:40 ca02 letheand[25437]: 2019-02-23 13:22:40.056 7f87be9dbb80 INFO global src/daemon/protocol.h:55 Initializing cryptonote protocol...
Feb 23 13:22:40 ca02 letheand[25437]: 2019-02-23 13:22:40.056 7f87be9dbb80 INFO global src/daemon/protocol.h:60 Cryptonote protocol initialized OK
Feb 23 13:22:40 ca02 letheand[25437]: 2019-02-23 13:22:40.056 7f87be9dbb80 INFO global src/daemon/p2p.h:63 Initializing p2p server...

@ronnylov
Copy link
Author

ronnylov commented Feb 23, 2019

Installed by the easy-deploy-node.sh script.
Starting letheand manually by just entering letheand in terminal works without problem.
I beleive there is something that need to be changed in the letheand.service file
https://github.com/LetheanMovement/lethean-vpn/blob/master/conf/letheand.service

systemctl status letheand looks like everything is fine.
But in reality the service keeps on to restart itself in the background in a never ending loop.

@ronnylov
Copy link
Author

"Service hold-off time over, scheduling restart."
Is there a timeout somewhere?

@ronnylov
Copy link
Author

So I took a look at one of my older nodes where I created the service file myself.

cat /etc/systemd/system/letheand.service

[Unit]
Description=Lethean Full Node
Wants=network-online.target
After=network.target network-online.target

[Service]
User=lethe
Group=lethe
WorkingDirectory=/home/lethe/
RuntimeDirectory=/home/lethe/lethean/build/release/bin/

Type=forking
PIDFile=/home/lethe/letheand.pid
ExecStart=/home/lethe/lethean/build/release/bin/letheand  \
    --detach --pidfile /home/lethe/letheand.pid \
    --rpc-bind-ip 0.0.0.0 --restricted-rpc \
    --confirm-external-bind --hide-my-port --limit-rate-up 640

Restart=always

[Install]
WantedBy=multi-user.target

Note I use this one as remote node too so I added some options for that.

@ronnylov
Copy link
Author

ronnylov commented Feb 23, 2019

Created a custom service and this one works for me.
My user running the exit node is lethe

lethe@ca02:~$ cat /etc/systemd/system/custom-letheand.service

[Unit]
Description=Lethean Full Node
Wants=network-online.target
After=network.target network-online.target

[Service]
User=lethe
Group=lethe
WorkingDirectory=/home/lethe/
RuntimeDirectory=/opt/lthn/bin/

Type=forking
PIDFile=/home/lethe/letheand.pid
ExecStart=/opt/lthn/bin/letheand  \
    --detach --pidfile /home/lethe/letheand.pid \
    --rpc-bind-ip 0.0.0.0 --restricted-rpc \
    --confirm-external-bind --hide-my-port --limit-rate-up 640

Restart=always

[Install]
WantedBy=multi-user.target

@valiant1x
Copy link
Contributor

I am not sure if this issue is still present in the current master. Keeping issue open until we have confirmation

@ronnylov
Copy link
Author

ronnylov commented Mar 9, 2019

I am still having this issue in the current master. My workaround using a customized systemd unit file (I created the custom-letheand.service as described above) still works for me. However I removed the line with RuntimeDirectory in my customized file because it gave warning messages about that it was not right.

@limosek
Copy link
Contributor

limosek commented Apr 3, 2019

There are new service definitions in dpkg branch:
https://github.com/LetheanMovement/lethean/tree/feature/limosek/dpkg/debian
You can look there if it will work for you.

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

No branches or pull requests

3 participants