neo-node
neo-node copied to clipboard
Neo CLI requires tty to start
It's impossible to start neo-cli with command
dotnet neo-cli.dll /rpc
if this process wouldn't have a tty allocated. The only way to run neo-cli with no terminal attached (in case if I'd like to run it in a docker container, for instance) is smth like
screen -DmS node dotnet neo-cli.dll /rpc
,
i.e. allocate tty anyway.
I wonder, is it really necessary? If it's not, would you be so kind to get rid of this minor, but annoying defect?
@aprasolova did you tried run neo-cli.dll --rpc
?
UPD: as I understand, Anastasia want to run node as daemon (service in Windows terminology), without interpritator-mode. It's a great feature for production environment
You're right @aprasolova but you can use screen
or tmux
. 😅
You can create a systemd services as workaround.
[Unit]
Description=neo-cli service
After=network-online.target
Requires=network-online.target
[Service]
WorkingDirectory=/opt/neo-cli
ExecStart=/usr/bin/tmux new-session '/usr/bin/dotnet neo-cli.dll --rpc'
ExecStop=/usr/bin/pkill -SIGTERM -f neo-cli
Restart=always
TimeoutSec=5
RestartSec=10
StandardInput=tty-force
TTYPath=/dev/tty2
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=neonode
User=node
Group=node
[Install]
WantedBy=multi-user.target
@belane as I said before, “screen” is good for developing, but what about production?
Meanwhile I have been using it in production environment for a long time without any problem.
@belane just look at any linux daemon, they doesn't need any screen
to work..
I think, screen
is good idea for development (as I said before), but for production env, I don't understand the need of screen
UPD: without any problem
I didn't say, that there was a some problem.. just screen
is unnecessary layer
@belane, NEO-node with screen (or tmux) works fine for sure, but do it really need a shell?
Systemd service is not a workaround, because in ExecStart
section it spawns new shell as well. :)
My point is that server process is /usr/bin/dotnet neo-cli.dll --rpc
, but it requires an allocated tty to start for some reason. I believe if a user could start NEO-node as a server with just running /usr/bin/dotnet neo-cli.dll --rpc
then it would look more clear.
I reported this issue with an intention to propose a little enhacement: to get rid of a tty when one starts a NEO-node as a server. What do you think on it?
Definitely, we should try to improve this
@aprasolova thanks for the suggestion, it has been decided to add this feature. At some point this issue will be closed to add it to a list of cosmetic changes.