node-red 寫成服務時遇到 typeerror the path argument must be of type string. received type undefined

之前有在我的NUC的VM上架過node-red
這次把它寫成服務時 卻噴了
typeerror the path argument must be of type string. received type undefined
這個錯誤

以下是我服務寫成的內容

[Unit]

Description=node-redd Daemon

after=network.target



[Service]

Type=forking

ExecStart=/home/node-red-start.sh

ExecStop=/home/node-red-stop.sh

StandardOutput=tty



[Install]

WantedBy=multi-user.target



node-red-stop.sh:

#!/bin/sh

ps aux | grep node-red | awk '{print $2}' | xargs kill -9



node-red-start.sh:

#!/bin/sh

node-red &



會噴出錯誤的原因主要是我之前居然是用root開node-red的
他找不到我放在 /root/.node-red/settings.js
所以把node-red-start.sh 內容修改一下:



#!/bin/sh

node-red -s /root/.node-red/settings.js &



就行了

留言

這個網誌中的熱門文章

centos7 架設 snort IDS (版本2.9.13)

在debian10 安裝 docker 以及 Logon Tracer