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: ...
随机推荐
- PhpStorm之服务器篇
打开编辑器,依次点击 Tools->Deloyment->Configuration,进入连接服务器的配置页面 2.点击左上角的 + ,配置一个新的服务器 3.填写添加之后服务器的名称,并 ...
- Codeforces 711B 【模拟】
比赛的时候绝壁打麻烦了... 考虑的好麻烦...wa7...还要判断出来的是不是positive的... 好吧..认了.. #include<cstdio> #include <ma ...
- [热拔插] 轻量级Winform插件式框架
写在前面的话 对于大神,Winform这种“古董玩具”,实在没太多“技术性”可言了,然而『好用才是王道』,本文不以技术为卖点,纯属经验之谈,欢迎交流拍砖 朴素版UI 开发初衷 由于本人所在公司不定时需 ...
- IT兄弟连 JavaWeb教程 ServletContext对象
ServletContext是Servlet与Servlet容器之间直接通信的接口.Servlet容器在启动一个Web应用时,会为它创建一个ServletContext对象.每个Web应用都有唯一的S ...
- C#批量插入Sybase数据库,Anywhere 8
数据库版本是Adaptive Server Anywhere 8 1.添加引用,程序集 iAnywhere.Data.AsaClient.这个和SQLServer的System.Data.SqlCli ...
- Comet OJ - Contest #4--前缀和
原题:Comet OJ - Contest #4-B https://www.cometoj.com/contest/39/problem/B?problem_id=1577传送门 一开始就想着暴力打 ...
- scanf()和scanf_s()
在最初的C语言中,原版的输入就是scanf("<格式化字符串>",<地址表>) ANSI C中没有scanf_s(),只有scanf(),scanf()在读 ...
- April Fools Contest 2017 C
Description DO YOU EXPECT ME TO FIND THIS OUT? WHAT BASE AND/XOR LANGUAGE INCLUDES string? DON'T BYT ...
- Music in Car CodeForces - 746F
Music in Car CodeForces - 746F 题意很难懂啊... 题意:http://blog.csdn.net/a838502647/article/details/74831793 ...
- 在eclipse中配置Tomcat并将项目部署到Tomcat上
参考:http://blog.csdn.net/yerenyuan_pku/article/details/51830104 首先在点击window窗口然后preferences 然后点击Add,选择 ...