Nodejs,Forever和SystemD启动问题

我正试图在启动时启动一个简单的nodejs应用程序,作为使用systemd的概念certificate,并且对于我的生活无法正常工作。

如果我这样做,它工作得很好: systemctl start simple-empty-app.service

但是,如果我重新启动系统甚至不尝试加载,syslog中似乎没有任何东西表明它甚至正在尝试它(但还有一些其他systemd启动消息,所以我知道systemd正在做它的东西。 ..)。

我的.service脚本如下所示:

 [Unit] Description=This is an empty tiny app for testing the nodejs deployment agent [Service] StandardOutput=syslog SyslogIdentifier=simple-empty-app Type=forking Environment=ENV=production Environment=PATH=/usr/bin:/usr/local/bin WorkingDirectory=/var/opt/nodejs-agent/node_modules/simple-empty-app ExecStart=/usr/local/bin/forever start --pidFile /var/run/simple-empty-app.pid /var/opt/nodejs-agent/node_modules/simple-empty-app/app.js ExecStop=/usr/local/bin/forever stop /var/opt/nodejs-agent/node_modules/simple-empty-app/app.js PIDFile=/var/run/simple-empty-app.pid User=root 

重新启动后systemctl status simple-empty-app.service显示:

 simple-empty-app.service - This is an empty tiny app for testing the nodejs deployment agent Loaded: loaded (/var/opt/nodejs-agent/node_modules/simple-empty-app/simple-empty-app.service; linked) Active: inactive (dead) CGroup: name=systemd:/system/simple-empty-app.service 

只是为了certificate它手动启动:

 root@karls-debian:~# systemctl start simple-empty-app.service root@karls-debian:~# systemctl status simple-empty-app.service simple-empty-app.service - This is an empty tiny app for testing the nodejs deployment agent Loaded: loaded (/var/opt/nodejs-agent/node_modules/simple-empty-app/simple-empty-app.service; linked) Active: active (running) since Fri, 11 Apr 2014 17:34:24 +0100; 4s ago Process: 1558 ExecStart=/usr/local/bin/forever start --pidFile /var/run/simple-empty-app.pid /var/opt/nodejs-agent/node_modules/simple-empty-app/app.js (code=exited, status=0/SUCCESS) Main PID: 1566 (node) 

任何人有任何想法? 如果有帮助的话,显然我已经从debian systemd-sysv回顾性地安装了systemdsystemd-sysv ,因为它没有被系统化。 而我在Wheezy

    修正了它,只需要以下部分:

    [Install] WantedBy = multi-user.target