كيفية إدارة الخدمات باستخدام systemd على Ubuntu

كيفية إدارة الخدمات باستخدام systemd على Ubuntu

يتحكم systemd في الخدمات (daemons) على Ubuntu. استخدم systemctl لتشغيلها وإيقافها ومراقبتها.

أوامر الخدمات الشائعة

sudo systemctl start nginx     # start now
sudo systemctl stop nginx      # stop now
sudo systemctl restart nginx   # restart
sudo systemctl reload nginx    # reload config without downtime
sudo systemctl status nginx    # check status

تفعيل الخدمات عند الإقلاع

sudo systemctl enable nginx    # start automatically at boot
sudo systemctl disable nginx   # don't start at boot
sudo systemctl enable --now nginx   # enable + start together

عرض السجلات

journalctl -u nginx           # logs for a service
journalctl -u nginx -f        # follow live
journalctl -xe                # recent errors

استخدم systemctl list-units --type=service لعرض جميع الخدمات قيد التشغيل.

هل كانت المقالة مفيدة ؟

15 أعضاء وجدوا هذه المقالة مفيدة

Powered by WHMCompleteSolution