systemctl automatically restart service

 Pothi Kalimuthu  Linux  October 9, 2016 0 Minutes

References:

  1. Ensure systemd services restart on failure by Jon Archer
  2. php-fpm systemd unit with auto-restart by Juan Luis Boya García
  3. systemd Project Web Page

systemd is a system and service manager that runs as PID 1 and starts the rest of the system and services. The main command used to introspect and control systemd is systemctl.

Basically do the following to let a service restart automatically…

  • Edit /lib/systemd/system/name.service file
  • Insert “Restart=on-failure” under the section “Service”. Save the file
  • Execute the command… systemctl daemon-reload
  • Execute the command… systemctl restart name_of_the_service
  • (optional) try killing the process now

See https://wiki.archlinux.org/index.php/Systemd#Examples for more examples.

systemctl automatically restart service的更多相关文章

  1. Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details

    thinkphp 在Apache上配置启用伪静态,重启Apache1 restart 竟然失败了,报错 Job for httpd.service failed because the control ...

  2. Linux 重启网卡失败 Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

    linux下重启网卡使用命令 : service network restart 时报错: [root@slave01 hadoop]# service network restart Startin ...

  3. Centos7下的systemctl命令与service和chkconfig

    博主使用的操作系统是最新的CentOS 7,所以可能和网上一些老的博文有一定出入,那是因为版本更新的原因. 这里写图片描述1 service service命令用于对系统服务进行管理,比如启动(sta ...

  4. 通过 systemctl 设置自定义 Service

    如果要在Linux 上设置一个开机自启,出现问题自动重启,并且有良好日志的程序,比较流行的方法有 supervisord.systemd,除此之外,还有 upstart.runit 等类似的工具. 但 ...

  5. systemctl enable rc-local.service error

    /******************************************************************************* * systemctl enable ...

  6. 启动Nginx服务失败:Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

    首次接触nginx,安装完使用命令 service nignx restart  后,出现这个错误,并按照提示给出的命令查看错误详情  systemctl status nginx.service   ...

  7. 对比centos7的systemctl和其他service+chkconfig

    syetemctl就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了.systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig ...

  8. 有关linux中出现systemctl status network.service" and "journalctl -xe" for details.

    Job for network.service failed because the control process exited with error code >**[root@mina0 ...

  9. Linux系统Docker启动问题Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"

    在Liunx中使用Docker, 注: Liunx使用的是在虚拟机下的centOS7版本在刚开始安装Docker时没有任何错误, 但是在后续的docker启动过程中, 出现以下问题: [root@zk ...

随机推荐

  1. elasticsearch启动日志报错not enough master nodes discovered during pinging (found [[]], but needed [-1]), pinging again

    排查步骤 逻辑上讲是,一个节点去ping  master节点,结果却没有得到回应,多次重试依旧失败.应该重点观察: 1.master启动后,IP是否可以有防火墙权限,设置防火墙规则或则直接关闭防火墙 ...

  2. 【Matlab开发】函数bsxfun的使用

    [Matlab开发]函数bsxfun的使用 标签:[Matlab开发] 版权声明:本文为博主原创文章,转载请注明出处http://blog.csdn.net/lg1259156776/. 说明:当我们 ...

  3. java 访问数据库公共类

    package com.javaweb.mvc; import java.sql.*; /** * @author 公共数据访问类 * * Statement 和 PreparedStatement之 ...

  4. Python时间日期格式化之time与datetime模块

    1 引言 在实际开发过程中,我们经常会用到日期或者时间,那么在Python中我们怎么获取时间,以及如何将时间转换为我们需要的格式呢?在之前的开发中,也曾遇到time.datetime等模块下的不同函数 ...

  5. Springboot 使用Jwt token失效时接口无响应(乌龙)

    问题背景:新项目使用Springboot框架,鉴权使用了Jwt 处理cors: @Configuration public class WebMvcConfig implements WebMvcCo ...

  6. Python初始

    一,Python介绍 1.Python简介 python的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,吉多·范罗苏姆(中文名字:龟叔)为了在阿姆斯特丹打发时间, ...

  7. 5个Linux性能命令

      使用几个命令就可以管理Linux系统的性能了,下面列出了5个最常用的Linux性能命令,包括top.vmstat.iostat.free和sar,它们有助于系统管理员快速解决性能问题. (1)to ...

  8. 正确理解使用Vue里的nextTick方法

    最近,在项目中要使用Swiper做一个移动端轮播插件.需要先异步动态加载数据后,然后使用v-for渲染节点,再执行插件的滑动轮播行为.解决这个问题,我们通过在组件中使用vm.$nextTick来解决这 ...

  9. Kettle无法打开文件资源库

    问题: Kettle无法打开文件资源库. 问题描述: 新建文件资源库之后,资源库路径中有中文路径.退出kettle之后,再次进去发现没有了右上角的connect按钮了. 原因: kettle的repo ...

  10. Python补充4——替换与修改

    最近在自学Python ,在学习过程中发现一个问题,就是Python 的替换与修改. 按照中文思维,替换与修改有什么区别吗?如果发生了部分替换不就是修改了吗?如果修改了不就是新对象替换了老对象吗? 实 ...