LearningLinux
  • Introduction To Linux Operating System
  • CentOS Installation
  • File System Hierarchy
  • Hardware Device
  • Boot Process
  • User and Application,Kernel,Shell
  • Symbols
  • Terminal Overview
  • System Command
  • File Paths
  • Linux File/Folder Properties
  • Linux Basic Command
  • Tar Command
  • Creating User and User Information Command
  • Group Information Command
  • Root Password Recovery(Redhat Distro)
  • Controlling Service
  • IP Address Assign Redhat Distro
  • NIC Bonding
  • File Permission
  • Access Control List (ACL)
  • Default Permission
  • Software Package Managing Tools
  • Connect Via SSH To Your Server
Powered by GitBook
On this page

Was this helpful?

Controlling Service

PreviousRoot Password Recovery(Redhat Distro)NextIP Address Assign Redhat Distro

Last updated 4 years ago

Was this helpful?

Controlling Service ဆိုတာကတော့ ကျွန်တော်တို့အသုံးပြုနေသည့် Linux Serverပေါ်မှာ run နေသည့် serviceများစွာရှိပါသည်။အဲ့ဒီ Service များကိုထိန်းချုပ်ရန် systemctl command ဖြင့်လုပ်ဆောင်ရပါသည်။

Application တွေကို သူက Unit လို့သတ်မှတ်ပြီးတော့ Unit တစ်ခုမှာ (1)Service (2)Socket (3)Path ဆိုပြီးရှိပါသည်။ systemctl command ကဘာတွေလုပ်လဲဆိုတော့ Actvie/Inactive ဖြစ်နေသည့်

Service တွေကိုကြည့်ရန်,ပြီးတော့အဲ့ Service တွေက Enable/Disable ဖြစ်လား,unit တစ်ခုရဲ့ status ကိုသိချင်တဲ့အခါ သုံးသည့် Command ဖြစ်ပါသည်။

- ရှိသမျှ Unit တွေကိုအကုန်သိချင်ရင် # systemctl list-unit-files ဆိုပြီးကြည့်နိုင်ပါသည်။

- Running ဖြစ်နေသည့် Unit တွေကိုသိချင်ရင်တော့ # systemctl list-units ဆိုပြီးကြည့်နိုင်ပါသည်။

- Failed ဖြစ်နေသည့် Unit တွေကိုသိချင်ရင် # systemctl --failed ဆိုပြီးကြည့်နိုင်ပါသည်။

- Unit တစ်ခုချင်းစီရဲ့ Status ကိုသိချင်ရင်တော့ #systemctl status NetworkManager ဆိုပြီးကြည့်နိုင်ပါသည်။

- Enable / Disable ဖြစ်နေသည့် Unit တွေကိုသိချင်ရင်တော့ # systemctl list-unit-files --type=service ဆိုပြီးကြည့်နိုင်ပါသည်။

- Unit တွေကို start,stop,restart,reload,mask,unmask လုပ်ချင်ရင်တော့အသုံးပြုရမည့် Commandက -

# systemctl start sshd (Enabled ssh service)

# systemctl stop sshd (Disabled ssh service)

# systemctl reload sshd (Reload ssh service)

# systemctl status sshd (Status ssh service)

- service တွေကို startလုပ်လို့မရအောင်လုပ်ချင်ရင် mask ကိုအသုံးပြုနိုင်ပါတယ်။maskကိုအသုံးပြုတာနဲ့ မှားပြီးတော့ start မိရင်တောင် service start ဖြစ်မှာမဟုတ်ပါ။

ပြန်ဖျက်ချင်ရင်တော့ unmask ကိုအသုံးပြုနိုင်ပါသည်။mask လုပ်ထားခြင်းဖြင့် system ကို crash ဖြစ်စေမည့် service တွေအတွက် stopလုပ်ထားခြင်းထပ်maskဖြင့်အသုံးပြုနိုင်ပါသည်။

# systemctl mask sshd

# systemctl unmask sshd

- service တွေကို Kill လုပ်ချင်တော့ # systemctl kill sshd ဆိုပြီးအသုံးပြနိုင်ပါသည်။