有关在 Synology NAS 上继续运行 Javascript 应用程序的问题
我的目标是让应用程序在 Synology 上运行,我可以运行在 SSH 中连接的应用程序,一切都很好,但当我关闭连接时,应用程序显然会停止工作。
我对 Unix 和 co 不是很专家。所以我的实际解决方法是:
Guacamole Docker + Firefox Docker:我连接到 firefox docker,然后使用 guacamole 进行 ssh 并从那里运行应用程序。我可以关闭所有内容,应用程序仍然运行良好。但我知道我为了一项简单的任务而浪费了太多的一切。
我确信有更好的方法来实现这一目标,所以有人可以帮助我吗?提前致谢!
my goal is to keep an app running on my Synology, i can run the app connecting in SSH and everything is fine but when i close the connection obviously the app stop to work.
I'm not very expert with Unix and co. so my actual workaround for this is that:
Guacamole Docker + Firefox Docker: I connect to the firefox docker, then use guacamole for the ssh and run the app from there. I can close everything and the app is still running fine. But I know I'm wasting so much everything for an easy task.
I know for sure that there is a better way to accomplish that so can anyone help me? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,当您在 shell 中启动某些内容时,该内容就会绑定到该 shell,因此当您终止 shell 时(例如关闭 ssh 连接时),绑定到它的任何内容也会终止。
为了让您的进程在 shell 终止后继续存在,您必须将其分离,有多种方法可以做到这一点,而且我对 Synology 使用的特定 unix 发行版没有经验,所以我不能 100% 确定,但这可能会起作用:<一href="https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session">https://askubuntu.com/questions/8653/how-to- keep-processes-running-after-ending-ssh-session
它使用软件 tmux 来执行分离操作。
也就是说,使用 docker 并不是一个坏主意。我认为不会有任何明显的性能差异或资源浪费。
Usually, when you start something in a shell, that something is bound to that shell, so when you terminate the shell (like when you close the ssh connection) whatever was bound to it also terminates.
For your process to survive the shell termination, you have to detach it, there are various ways to do it and I'm not experienced in the specific unix distribution that Synology uses so I can't be 100% sure but this will probably work: https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session
It uses a software, tmux, to do the detatching thing.
That said, using docker is not a bad idea. I don't think there will be any noticeable performance difference or wasted resources.