/etc/systemd/system/parsoid.service

/etc/systemd/system/parsoid.service

我只是尝试启动我的节点应用程序,因为service我指向该server.js文件并将其设置为可执行文件。

我希望这个节点应用程序在服务器重新启动时重新启动,并且通常能够将其用作服务。

/etc/systemd/system/parsoid.service

[Unit]
Description=MediaWiki Parsoid Server

[Service]
ExecStart=/var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
Restart=always
User=nobody
# Note Debian/Ubuntu uses 'nogroup', RHEL/Fedora uses 'nobody'
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/var/www/gwart/mediawiki/extensions/VisualEditor/parsoid

[Install]
WantedBy=multi-user.target 

但是,当检查服务是否正在运行时,它不会启动。节点应用程序通过执行以下操作可以正常启动node /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js

错误

root@server:/etc/systemd/system# systemctl status parsoid.service 
● parsoid.service - MediaWiki Parsoid Server
   Loaded: loaded (/etc/systemd/system/parsoid.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Sat 2018-12-15 20:35:57 GMT; 1s ago
  Process: 8565 ExecStart=/var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js (code=exited, status=127)
 Main PID: 8565 (code=exited, status=127)

Dec 15 20:35:56 server.live-servers.net systemd[1]: parsoid.service: Unit entered failed state.
Dec 15 20:35:56 server.live-servers.net systemd[1]: parsoid.service: Failed with result 'exit-code'.
Dec 15 20:35:57 server.live-servers.net systemd[1]: parsoid.service: Service hold-off time over, scheduling restart.
Dec 15 20:35:57 server.live-servers.net systemd[1]: Stopped MediaWiki Parsoid Server.
Dec 15 20:35:57 server.live-servers.net systemd[1]: parsoid.service: Start request repeated too quickly.
Dec 15 20:35:57 server.live-servers.net systemd[1]: Failed to start MediaWiki Parsoid Server.

[编辑]

Dec 15 20:57:33 server88-208-249-95.live-servers.net systemd[1]: [/etc/systemd/system/parsoid.service:5] Executable path is not absolute, ignoring: node /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
Dec 15 20:57:33 server.live-servers.net systemd[1]: parsoid.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
root@server:/etc/systemd/system# /var/www/gwart/mediawiki/extensions/VisualEditor/parsoid/bin/server.js
Error while reading config file: Error: ENOENT: no such file or directory, open '/etc/systemd/system/config.yaml

相关内容