FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


os:package:centos-service.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
os:package:centos-service.html [2017/12/04 01:41]
kurihara ↷ Page moved from os:centos-service.html to os:software:centos-service.html
— (current)
Line 1: Line 1:
-[[os:conf:index.html]] 
-~~NOTOC~~ 
-====== CentOS Service Enable/Disabple====== 
  
- 
-===== Operation ===== 
- 
-<sxh bash toolbar:false gutter:false> 
-$ echo a |fab -l |grep service 
- 
-$ echo xx.xx.xx.xx | fab  pro  centos_service.centos7_common 
-</sxh> 
- 
-\\ 
-===== centos_service.py ===== 
- 
-<sxh python toolbar:false gutter:false> 
-import sys 
-from fabric.api import * 
-from fabric.contrib import files 
- 
- 
-#------------------------------------------------------------------------------- 
-# CentOS7 
-#------------------------------------------------------------------------------- 
-@task 
-def centos7_check_service(): 
-    sudo("systemctl list-unit-files -t service |egrep "enable|disable" |sort -k 3") 
- 
-@task 
-def centos7_common(): 
-    #enable 
-    sudo("systemctl enable sysstat.service") 
-    sudo("systemctl enable snmpd.service") 
- 
-    #disable 
-    sudo("systemctl disable firewalld.service") 
-    sudo("systemctl disable NetworkManager.service") 
- 
- 
- 
-#------------------------------------------------------------------------------- 
-# CentOS6 
-#------------------------------------------------------------------------------- 
- 
-</sxh> 
- 
- 
-\\ 
-<WRAP box 90%> 
-[[:index.html#OS Management|Top#OS Management]] 
-<catlist -noAddPageButton -noHead> 
-</WRAP> 
-\\ 
-[[os:conf:index.html]] 


os/package/centos-service.html.1512319309.txt.gz · Last modified: 2017/12/04 01:41 by kurihara