Tag: systemd

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 […]

如何在CentOS 6.6 vps上部署使用Visual Studio开发的Node JS应用程序

这是我第一次使用Node JS ,因为我的背景是.NET技术,所以我使用Visual Studio和Node.JS Tools来开发项目的Web服务。 我使用express , node-rest-client和mysql模块构buildWeb服务。 WS在我的环境中testing时工作正常,现在可以利用systemd将它部署到我自己的CentOS 6.6 VPS的生产环境中。 我习惯在IIS上部署WCF和Web API Web服务,在这种情况下,这个过程似乎是完全不同的。 我尝试使用Google,但答案和教程似乎并不简单,有时甚至是矛盾的。 是否有一些额外的步骤来部署在Visual Studio中创build一个基于* nix的系统的项目? 我应该如何进行部署和(可能)使它与systemd运行?

系统服务启动失败

我试图让一个nodejs服务器在启动时运行,所以我创build了下面的systemd单元文件: [Unit] Description=TI SensorTag Communicator After=network.target [Service] ExecStart=/usr/bin/node /home/pi/sensortag-comm/sensortag.js User=root [Install] WantedBy=multi-user.target 我不确定我在这里做错了什么。 在nodejs脚本启动之前,它似乎失败了,因为没有logging发生。 我的脚本依赖于MySQL 5.5(我认为这是我遇到问题的地方)。 任何洞察力,甚至不同的解决scheme,将不胜感激。 此外,一旦我login到系统,它运行良好。 更新 该服务已启用,正在通过journalctl进行日志logging。 我将在7/11/16更新结果。 不知道为什么它第一次没有工作,但检查journalctl的问题是100%,MySQL没有启动。 我再次将其更改为After=MySQL.service ,它完美的工作!

从systemd节点应用程序生成的Shell脚本不会编辑etc文件

我有一个systemd服务,在启动时启动一个Node应用程序。 Node应用程序使用child_process.spawnSync启动一个使用sed编辑/etc/wpa_supplicant/wpa_cli-actions.sh的shell脚本。 如果我从命令行手动启动Node应用程序,但是在由systemd启动应用程序时没有正确编辑wpa_cli-actions.sh文件,则该文件会被正确编辑。 我的系统服务文件是基于另一个启动类似的服务,所以我不知道我在做什么错了。 我在journalctl输出中没有看到与此有关的任何错误。 以下是我的服务文件。 [Unit] Description=The Edison status and configuration service After=mdns.service [Service] ExecStart=/bin/su root -c 'node /usr/lib/config-server/app.js' Restart=always RestartSec=10s StandardOutput=journal StandardError=journal SyslogIdentifier=edison-config PrivateTmp=no Environment=NODE_ENV=production User=root Group=root [Install] WantedBy=default.target

当Nodejs应用程序开始使用Systemd时,Nodejs App不会产生pythonsubprocess

我想在启动时启动节点js应用程序。 因此我从Systemd启动一项服务: [Unit] Description=Node.js server After=network.target [Service] ExecStart=/usr/bin/node /var/www/Raspberry-Pi-Status/js/server.js Restart = always RestartSec=10 StandardOutput=syslog StandardError=syslog SyslogIdentifier=nodejs-server Environment=NODE_ENV=production PORT=8000 Environment=PYTHONPATH=/usr/bin/python [INSTALL] WantedBy=multi-user.target server.js看起来像这样: var util = require('util'), spawn = require('child_process').spawn, py = spawn('python',['temperature.py'],{detached: true}); var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'monitor', password : 'password', database : 'temps'}); var app […]

没有使用systemd套接字激活的数据

我有两个小systemd套接字和服务文件: sockets: [Socket] ListenStream=80 # also tried with Accept=no [Install] WantedBy=sockets.target 服务: [Unit] Description=Test Webserver [Service] EnvironmentFile=/path/to/node-script.env ExecStart=/path/to/node /path/to/server.js Restart=always StandardOutput=syslog StandardError=syslog SyslogIdentifier=node-script Type=simple User=test-user Group=test-user [Install] WantedBy=sockets.target ENV: PORT=80 我有一个小小的Node.js脚本: var http = require('http'); var server = http.createServer(); server.on('connection', function(conn) { // socket connection console.log('new connection', conn.address()); conn.on('data', function(data) { console.log('more data', data.length); }); […]