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 ...
随机推荐
- Retrotranslator使用简介(JDK1.5->1.4)
Retrotranslator是一个可以把JDK1.5(6)下编译的类(或包)转译成JDK1.4下可以识别的类(包)的工具. 为现在还用JDK1.4呢?我想无非是现在的大部分Java Web应用是 ...
- react-native 组件之间传值
1.通过 AsyncStorage 将值保存在本地(最低端的方法) import { AsyncStorage, } from 'react-native'; // 保存 IP AsyncStorag ...
- ArrayDeque 源码分析
ArrayDeque ArrayDeque 能解决什么问题?什么时候使用 ArrayDeque? 1)Deque 接口大小可变的循环数组实现,ArrayDeque 没有容量限制并会按需增长. 2)Ar ...
- windows10下安装docker报错:error during connect
详细报错信息如下: C:\Users\zig>docker info error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engin ...
- 一个有关Golang Deferred Function 执行顺序的问题
先看一下一段关于defer的解释, 引自<Go程序设计语言> Syntactically, a defer statement is an ordinary function or met ...
- 【ABAP系列】SAP 销售订单的行项目里条件的增强
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP 销售订单的行项目里条件的 ...
- spring中@Autowired与 @Resource区别
@Autowired 与@Resource的区别: 1. @Autowired与@Resource都可以用来装配bean. 都可以写在字段上,或写在setter方法上. 2. @Autowired默认 ...
- windows 10上玩耍ubuntu
win10 已经支持运行子系统ubuntu了. 安装ubuntu 程序和功能>>启用或关闭Windows功能>>勾选"适用于Linux的Windows子系统" ...
- 应用安全-安全设备-Waf系列-软Waf-安全狗(Safedog)
安装 - Linux 下载 http://download.safedog.cn/safedog_linux64.tar.gz wget http://download.safedog.cn/safe ...
- linux系统中的基础监控(硬盘,内存,系统负载,CPU,网络等)
Linux系统常见日常监控 系统信息 查看 CentOS 版本号:cat /etc/redhat-release 综合监控 nmon 系统负载 命令:w(判断整体瓶颈) 12:04:52 up 1 ...