小鬼之家

流浪,游走于文明与原始之间. 关注底层技术,实现美好生活。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

vi /usr/lib/systemd/system/pano.service

[Unit]
Description=pano - main site of site_name.com
Documentation=http://www.site_name.com/docs/

[Service]
ExecStart=/usr/local/bin/node /www/www.site_name.com/node/bin/www
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nobody
User=nobody
Group=nobody
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
# systemctl enable pano
# systemctl start pano

 

nginx的启动脚本/usr/lib/systemd/system/nginx.service

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target
 
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target

 

posted on 2014-10-09 16:38  黄尚  阅读(1493)  评论(0编辑  收藏  举报