The nice thing about the command above is that it shows a unified view of all options and takes into consideration any overrides that may have been applied.
To change the value of an option, ExecStart in this case, do the following:
[ec2-user@ip-10-0-46-113 ~]$ sudo systemctl edit docker
This will create the necessary directory structure under /etc/systemd/system/docker.service.dand open an editor (using the default editor configured for the user) to the override file. Add the section below into the editor:
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
It was necessary to clear out ExecStart using ExecStart= before setting it to the override value. This is only required for some options and most options in the configuration file would not need to be cleared like this
[Unit]
Description=Kibana 4
[Service]
Type=simple
User=logstash
Environment=CONFIG_PATH=/opt/kibana/config/kibana.yml
Environment=NODE_ENV=production
ExecStart=/opt/kibana/node/bin/node /opt/kibana/src/cli
[Install]
WantedBy=multi-user.target
man systemctl
man systemd.service
Certains paquets sont livrés avec leur .service qu'on ne veut pas forcément utiliser
Par exemple pour redis, on peut vouloir fiare tourner plusieurs redis sur la même machine (en créant nos .service dans /etc/systemd/system)
Du coup, le .service fourni de base n'est pas vraiment utile :
systemctl disable redis-server
Si on veut qu'il n'apparaisse plus du tout dans le listing systemctl :
rm /lib/systemd/system/redis-server.service
systemctl reset-failed redis-server