การกำหนดให้ service ของ linux start ตอนเปิดเครื่อง

Prawit Tangmanopeanchai
1 min readJun 27, 2019

--

ใช้คำสั่ง systemctl enable <service name>

ยกตัวอย่างจากการดูสถานะของ nginx service ด้วยคำสั่ง systemctl status nginx

จะเห็นว่าสถานะของการ start ตอนเปิดเครื่องของ service nginx เป็น “disabled” อยู่ หมายความว่าหากมีการปิดเครื่องแล้วเปิดใหม่ service ของ nginx จะไม่ auto start ให้

หากเราต้องการให้ service ของ nginx auto start ตั้งแต่ตอนเปิดเครื่องให้ทำการ enable โดยใช้คำสั่ง systemctl enable <service name> เช่น

systemctl enable nginx

จากนั้นลองตรวจสอบดูอีกครั้ง

--

--

Prawit Tangmanopeanchai
Prawit Tangmanopeanchai

Written by Prawit Tangmanopeanchai

Head of Cloud Implementation Unit at gosoft (Thailand)

No responses yet