كيفية إدارة الخدمات باستخدام 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 لعرض جميع الخدمات قيد التشغيل.