debian系列systemd 配置nodejs服务
1 新建service配置文件
vi /etc/systemd/system/node.service
[Unit]
Description=My super nodejs app
[Service]
# set the working directory to have consistent relative paths
WorkingDirectory=/home/root/Heroku/
# start the server file (file is relative to WorkingDirectory here)
ExecStart=/usr/bin/node /home/root/Heroku/server.js
# if process crashes, always try to restart
Restart=always
# let 500ms between the crash and the restart
RestartSec=500ms
# send log tot syslog here (it doesn't compete with other log config in the app itself)
StandardOutput=syslog
StandardError=syslog
# nodejs process name in syslog
SyslogIdentifier=nodejs
# user and group starting the app
User=root
Group=root
# set the environement (dev, prod…)
Environment=NODE_ENV=production [Install]
# start node at multi user system level (= sysVinit runlevel 3)
WantedBy=multi-user.target
2 启动服务
service star node
3 查看服务启动状态
systemctl status node
4 开机启动
systemctl enable node
参考:
1 https://riptutorial.com/node-js/example/28713/node-js-as-a-systemd-damon
debian系列systemd 配置nodejs服务的更多相关文章
- WCF系列教程之WCF服务配置工具
本文参考自http://www.cnblogs.com/wangweimutou/p/4367905.html Visual studio 针对服务配置提供了一个可视化的配置界面(Microsoft ...
- CentOS7系列--3.2CentOS7中配置iSCSI服务
CentOS7配置iSCSI服务 在网络上的存贮服务为iSCSI Target,而连接到iSCSI Target服务的叫iSCSI Initiator 1. 直接配置iSCSI Target服务 1. ...
- CentOS7系列--3.1CentOS7中配置NFS服务
CentOS7配置NFS服务 1. 配置NFS服务器端 1.1. 安装nfs-utils软件 [root@server1 ~]# yum install -y nfs-utils Loaded plu ...
- 在Debian系列Linux系统Ubuntu上安装配置yum的试验
用习惯了Red Hat系统的都知道我们习惯于三种安装方式:一种是rpm包的方式安装,一种就是tar包的方式来安装,还有一种方式就是yum源的安装. 首先rpm包的用法,我们一般是在Red Hat光驱里 ...
- SpringCloud系列九:SpringCloudConfig 基础配置(SpringCloudConfig 的基本概念、配置 SpringCloudConfig 服务端、抓取配置文件信息、客户端使用 SpringCloudConfig 进行配置、单仓库目录匹配、应用仓库自动选择、仓库匹配模式)
1.概念:SpringCloudConfig 基础配置 2.具体内容 通过名词就可以发现,SpringCloudConfig 核心作用一定就在于进行配置文件的管理上.也就是说为了更好的进行所有微服务的 ...
- CentOS7系列--2.2CentOS7中配置SSH服务
CentOS7配置SSH服务 1. SSH配置 1.1. 使用SSH服务更加安全 [root@centos7 ~]# vi /etc/ssh/sshd_config 设置如下 PermitRootLo ...
- CentOS7系列--2.1CentOS7中安装配置NTP服务
CentOS7安装配置NTP服务 NTP服务是时间同步服务 1. 安装NTPd [root@centos7 ~]# yum install -y ntp [jack@centos7 ~]$ vi /e ...
- MyCat源码分析系列之——配置信息和启动流程
更多MyCat源码分析,请戳MyCat源码分析系列 MyCat配置信息 除了一些默认的配置参数,大多数的MyCat配置信息是通过读取若干.xml/.properties文件获取的,主要包括: 1)se ...
- debian下samba配置
debian下samba配置 http://blog.chinaunix.net/uid-2282111-id-2113216.html 服务器端配置过程:1. apt-get install sa ...
随机推荐
- 170816-关于Java基础的习题
1. switch 括号里的可以是 int .char. byte.short.String,还有枚举类型,应用举例 不可以是long.double 2. 调用ma()方法之后,ma()方法将错误类型 ...
- Charles抓取手机https请求
1.下载Charles工具,3.92破解版:http://pan.baidu.com/s/1cko2L4 密码:chmy 2.安装SSL证书,默认安装就可以 3.证书安装成功后,点击详细信息--> ...
- Menu Items are not showing on Action Bar
http://stackoverflow.com/questions/18010072/menu-items-are-not-showing-on-action-bar 版权声明:本文为博主原创文章, ...
- ijkplayer阅读学习笔记之从代码上看播放流程
http://blog.csdn.net/i_do_can/article/details/51374732
- MySQL主从复制之半同步模式
MySQL主从复制之半同步模式 MySQL半同步介绍: 一般情况下MySQL默认复制模式为异步,何为异步?简单的说就是主服务器上的I/O threads 将binlog写入二进制日志中就返回给客户端一 ...
- ORA-00346,借助_allow_resetlogs_corruption开库
Mon Aug 06 10:15:08 2018Errors in file /data/app/oracle/diag/rdbms/prod/prod/trace/prod_ora_6831.trc ...
- 【opencv使用笔记】一:Python版本安装与测试
安装完opencv3.4.1并且Cmake后,发现Python不能import,又装了Python版本的opencv; 由于是在conda环境下安装,opencv-python-4.0.1.24,最终 ...
- SpringBoot整合SpringMVC完成文件上传
1.编写Controller /** * SPringBoot文件上传 */ //@Controller @RestController //表示该类下的方法的返回值会自动做json格式的转换 pub ...
- 如何统计序列中元素的频度---Python数据结构与算法相关问题与解决技巧
实际案例: 1. 某随机序列 [12,5,6,4,6,5,5,7]中,找到出现次数最高的3个元素,它们出现的次数是多少? 2. 对于某英文文章的单词,进行词频统计,找到出现次数最高的10个单词,它们出 ...
- Jmeter+ SeureCRT + Pinpoint
1.环境配置 [相关操作] 下载jdk http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.h ...