029systemctl使用经验总结

一、systemctl添加多启动参数

(1)问题:

systemctl在service部分的ExecStart后直接加参数是不能生效的;

(2)解决如下:

systemctl stop docker
cat /etc/.progconf
ARG1=-H fd://
ARG2=--containerd=/run/containerd/containerd.sock
ARG3=--registry-mirror=https://h7foiug3.mirror.aliyuncs.com

vim /usr/lib/systemd/system/docker.service
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --registry-mirror=https://h7foiug3.mirror.aliyuncs.com
EnvironmentFile=/etc/.progconf
ExecStart=/usr/bin/dockerd $ARG1 $ARG2 $ARG3

systemctl daemon-reload  
systemctl start docker

Reference: https://askubuntu.com/questions/1077778/how-do-i-pass-flags-when-starting-a-systemd-service

  

posted @ 2021-07-01 20:01  arun_yh  阅读(160)  评论(0编辑  收藏  举报