直接改 /lib/systemd/system 下的 unit 文件,升级会被覆盖。
用 systemctl edit 服务名,生成 override 片段文件。
片段里只写要改的项放进 [Service],其余继承原文件。
改完 daemon-reload 再 restart,用 cat 查最终值。
systemctl edit nginx.service
# 片段落在 /etc/systemd/system/nginx.service.d/override.conf
# [Service]
# MemoryMax=512M
systemctl daemon-reload
systemctl restart nginx
systemctl cat nginx.service
THE END






暂无评论内容