ubuntu 18.04 start myproject
#!/bin/bash
now=$(date +%Y%m%d)
cmd='/home/hu/go/src/github.com/coredns/coredns/coreserver -conf /home/hu/go/src/github.com/coredns/coredns/Corefile' start(){
exec $cmd &
} stop(){
ps -ef | grep "/home/hu/go/src/github.com/coredns/coredns/coreserver" | grep -v "grep" |awk '{print $2}'| while read pid
do
C_PID=$(ps --no-heading $pid | wc -l)
echo "当前PID=$pid"
if [ $C_PID = "1" ]
then
echo "PID=$pid 准备结束"
kill -9 $pid
echo "PID=$pid 已经结束"
else
echo "PID=$pid 不存在"
fi
done } case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
printf 'Usage: %s {start|stop|restart}\n'"$prog"
exit 1
;;
esac
download shell https://files.cnblogs.com/files/marklove/coredns-manage.zip
help
http://www.cnblogs.com/boshen-hzb/p/7541901.html
http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html
https://www.jb51.net/article/136559.htm
http://linux.51yip.com/search/systemctl
https://blog.csdn.net/chwshuang/article/details/68489968
https://www.linuxidc.com/Linux/2015-07/120833.htm
http://manpages.ubuntu.com/manpages/xenial/en/man5/systemd.unit.5.html
https://www.cnblogs.com/dongguolei/p/7902608.html
https://www.cnblogs.com/qiaoyanlin/p/6926981.html
cd /etc/systemd/system
Created croedns.service
[Unit]
Description = coredns remote control daemon
After = NetworkManager-wait-online.service network.target network-online.target dbus.service
Wants = NetworkManager-wait-online.service network-online.target
Requires = dbus.service [Service]
Type = forking
PIDFile = /var/run/coredns.pid
ExecStart = /home/hu/go/src/github.com/coredns/coredns/coredns -conf /home/hu/go/src/github.com/coredns/coredns/Corefile
Restart = on-abort
StartLimitInterval = 60
StartLimitBurst = 10 [Install]
WantedBy = multi-user.target
Alias = coredns.service
sudo systemctl daemon-reload
systemctl disable croedns.service// out
systemctl enable croedns.service
systemctl start croedns.service
systemctl stop croedns.service
systemd-analyze critical-chain croedns.service
reboot
systemctl list-units --failed
nslookup www.baidu.com
ubuntu 18.04 start myproject的更多相关文章
- ubuntu 18.04 搭建flask服务器(大合集,个人实操)
ubuntu 18.04 搭建flask服务器(大合集) Ubuntu python flask 服务器 本次使用的Ubuntu版本为:Ubuntu 18.04.5 LTS (GNU/Linux 4. ...
- Ubuntu 18.04 LTS修改 国内源(以中科大源为例)
国内有很多Ubuntu的镜像源,包括阿里的.网易的,还有很多教育网的源,比如:清华源.中科大源. 我们这里以中科大的源为例讲解如何修改Ubuntu 18.04里面默认的源. 可以进入这个链接进行下载: ...
- Ubuntu 18.04 启动root账号并授权远程登录
Ubuntu 18.04 刚刚上市2个月,下载安装,尝尝鲜~ 安装界面看上去舒服许多, 安装的速度也较之前17.04 和16.04 都快了许多.抱歉,未截图. Ubuntu 安装完成后默认不启动roo ...
- Ubuntu 18.04编译AOSP源码
总结一下我从Ubuntu 18.04下编译成功AOSP的过程,以及遇到的坑 我的电脑配置: OS: Ubuntu 18.04 bionic Kernel: x86_64 Linux 4.18.0-17 ...
- Ubuntu 18.04.1 LTS + kolla-ansible 部署 openstack Rocky all-in-one 环境
1. kolla 项目介绍 简介 kolla 的使命是为 openstack 云平台提供生产级别的.开箱即用的自动化部署能力. kolla 要实现 openetack 部署分为两步,第一步是制作 do ...
- Ubuntu 18.04中截图工具Shutter的编辑按钮不可用的解决办法
Shutter是一个由第三方提供的在Ubuntu上运行的截图工具,相对于系统自带的截图工具(默认可通过Ctrl + Shift + Print快捷键启动截图),最大的优点就是可以即时对图片进行编辑,在 ...
- 在Ubuntu 18.04系统上安装Systemback的方法(抄)
在Ubuntu 18.04系统上安装Systemback的方法 2018-12-26 21:39:05作者:林莉稿源:云网牛站 本文介绍如何在Ubuntu 18.04或者Ubuntu 18.10系统上 ...
- Ubuntu 18.04 记录
登录后死机,关机时死机的解决方法 更新内核并安装 Nvidia 显卡驱动可解决. 在内核更新为 4.15.18,Nvidia 显卡驱动为 390 时,问题解决. 使用 LiveCD 启动,然后 mou ...
- 【Ubuntu 18.04 搭建VNC服务器】
https://www.jianshu.com/p/f58fe5cdeb5f 桌面共享 Ubuntu 18.04自带桌面共享,可以将物理桌面共享给VNC.但是无法创建新的桌面. 具体参考 https: ...
随机推荐
- 网络爬虫之Selenium模块和Xpath表达式+Lxml解析库的使用
实际生产环境下,我们一般使用lxml的xpath来解析出我们想要的数据,本篇博客将重点整理Selenium和Xpath表达式,关于CSS选择器,将另外再整理一篇! 一.介绍: selenium最初是一 ...
- bzoj 1076: [SCOI2008]奖励关【状压dp+概率dp】
设f[i][s]为前i步,选的礼物集合为s的方案数,然而并不会转移-- 看了hzwer的blog,发现要倒着转移,然后答案就是f[1][0] 妙啊 #include<iostream> # ...
- IT兄弟连 JavaWeb教程 Servlet
Servlet的定义 Java Servlet是运行在Web服务器或应用服务器上的程序,它是作为来自Web浏览器或其他HTTP客户端的请求和HTTP服务器上的数据库或应用程序之间的中间层. 使用Ser ...
- autolayout UIImageView 根据 UILabel的宽度变换位置
仅个人学习笔记,大牛勿喷 代码写法 使用Masonry //昵称 _nameLableView = [[UILabel alloc]init]; [_nameLableView setTextColo ...
- iOS UITableView reloadData 刷新结束后执行后续操作
如果在reloadData后需要立即获取tableview的cell.高度,或者需要滚动tableview. 如果直接在reloadData后执行代码是有可能出问题的,比如indexPath为nil等 ...
- AtCoder Grand Contest 015 E - Mr.Aoki Incubator
题目传送门:https://agc015.contest.atcoder.jp/tasks/agc015_e 题目大意: 数轴上有\(N\)个点,每个点初始时在位置\(X_i\),以\(V_i\)的速 ...
- Codeforces Round #418 (Div. 2) B
Description Sengoku still remembers the mysterious "colourful meteoroids" she discovered w ...
- rac 添加 资源
10g : 自动化.监控.os,存储,底成,网络,规范
- js修改物理返回键功能
preventBack: function(theurl){ var pushState = window.history.pushState; //点击物理返回键时,退出到跳转定义首页 if(pus ...
- idea web项目热部署
之前用idea写web项目的时候,一直都是改一点东西就要重启一下,很烦.今天终于忍受不了百度了一下idea怎么热部署web项目. 在此记录下. 第一步 编辑tomcat配置 第二步 选择打包的项目,并 ...