node.js - 从 systemd 单元文件永远运行 index.js
问题描述
Beaglebone Debian 8.7;节点 v10.10.0
如上面链接中所述,尝试永远运行 .js 文件。这是我的 .service 单元文件的内容。
[Unit]
Description=myServer
DefaultDependencies=no
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
ExecStart=/root/.nvm/versions/node/v10.10.0/bin/forever start path/index.js
ExecStop=/root/.nvm/versions/node/v10.10.0/bin/forever stop path/index.js
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
使用命令# systemctl start myServer.service我收到以下错误。
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
myServer.service: Control process exited, code=exited status=1
但是使用命令永远启动 path/index.js;一切正常。
安装了 Forever-monitor。与控制台命令相比,为什么我的服务不起作用。
解决方案
推荐阅读
- python - 如何将保存的 Keras .h5 文件转换为 csv 文件或 .mat 文件
- algorithm - 以下函数在 big-O 表示法中的时间复杂度是多少?
- javascript - d3.js 图例不能与图表共享对象类型?
- google-sheets - 如何根据Google表格中的标志列获取垂直数据并水平提取数据?
- fortran - Fortran 和 OpenMP:如何声明和分配可分配的 THREADPRIVATE 数组
- excel - Excel VBA 中的 Google API 地理编码返回空白
- django - 使用 djangorestfrfamework-simplejwt 注册用户时生成 jwt
- android - Kotlin 这个游标应该在使用 #close 后被释放
- ruby-on-rails - 如何在 Rails 应用程序中重新排序表列?
- c# - foreach 比 for 慢 20 倍?