ubuntu 添加开机启动服务
新建umpserver.service
[Unit]
Description=UMPServer
After=syslog.target network.target remote-fs.target nss-lookup.target [Service]
Type=forking
ExecStart=/home/work/start.sh
ExecStop=/home/work/stop.sh
PrivateTmp=true [Install]
WantedBy=multi-user.target
添加可执行权限
chmod +x umpserver.service
把文件复制到/lib/systemd/system/目录下
cp umpserver.service /lib/systemd/system
添加开机启动
systemctl enable umpserver.service
移除开机启动
systemctl disable umpserver.service
启动或停止umpserver命令
systemctl stop umpserver.service
该指令,执行umpserver.service中,ExecStop属性中指定的脚本,如下图所示

启动umpserver命令,执行/home/work/start.sh脚本
systemctl start umpserver.service
重启命令:
systemctl restart umpserver.service
相当于,先执行umpserver的stop命令,在执行start命令。
查看是否开机启动命令:
systemctl list-unit-files |grep umpserver

enabled表示开机启动;disable表示开机不启用。
ubuntu 添加开机启动服务的更多相关文章
- (转) CentOS 7添加开机启动服务/脚本
CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...
- centos7之添加开机启动服务/脚本
一.添加开机启动脚本 #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to ...
- linux chkconfig添加开机启动服务
--add:增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据: --del:删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的 ...
- 【centos7】添加开机启动服务/脚本
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- centos7如何添加开机启动服务/脚本
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- CentOS7添加开机启动服务/脚本(延用CentOS6方法)
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- CentOS 7添加开机启动服务/脚本
一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以 jenkins 为例):systemctl enable jenkins.service #设置jenkins服 ...
- Linux—添加开机启动(服务/脚本)
系统启动时需要加载的配置文件 /etc/profile./root/.bash_profile/etc/bashrc./root/.bashrc/etc/profile.d/*.sh./etc/pro ...
- CentOS 7添加开机启动服务脚本
一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务 ...
随机推荐
- ERROR 1044 (42000): Access denied for user 'root'@'localhost'
从供应商那边接手一个MySQL数据库(数据库版本为5.7.21 MySQL Community Server (GPL)),在创建账号时遇到了"ERROR 1044 (42000): Acc ...
- Oracle解锁scott用户
解决: (1)conn sys/sys as sysdba;//以DBA的身份登录 (2)alter user scott account unlock;// 然后解锁 (3)conn scott/t ...
- django静态模版使用
第一步:在app目录下建立static文件夹,将CSS文件.js文件放到static文件夹下 第二步:TEMPLATES = [ { 'BACKEND': 'django.template.backe ...
- c/c++ 线性表之双向链表
c/c++ 线性表之双向链表 线性表之双向链表 不是存放在连续的内存空间,链表中的每个节点的next都指向下一个节点,每个节点的before都指向前一个节点,最后一个节点的下一个节点是NULL. 真实 ...
- [Hive_9] Hive 的排序
0. 说明 全排序(order by) | 部分排序(sort by) | hash 分区(distribute by) | cluster by 1. 前期准备 1.1 建表 create tab ...
- 【PAT】B1011 A+B 和 C
注意数据的范围,使用long long就行了 #include<stdio.h> int main(){ int N;scanf("%d",&N); for(i ...
- 解决ubuntu下,QQ重启后出现个人文件夹已被占用的问题
首先,是wine QQ的安转教程:Wine安装最新版QQ(8.9.2)的简单教程 - Powered by Discuz! 里面作者也提到了关于重启后出现个人文件夹被占用的情况. 如下: 这里,如果不 ...
- puppet使用 apache passsenger 作为前端 (debian)
目录 1. 概要 2. nginx + passenger 配置 2.1. package 安装 2.2. 配置文件设置 2.3. 测试配置结果 2.4. 参考网址 概要 之前做过 apache + ...
- 【转】10条你不可不知的css规则
10条你不可不知的css规则 Posted on 2006-12-20 10:33 雨中太阳 阅读(343) 评论(1) 编辑 收藏 :[译]10条你不可不知的css规则正文: Published D ...
- Fetch请求后台的数据
<style> #btn{ width: 50px; height: 50px; background-color: red; } #output{ width: 100px; heigh ...