Skip to content

Commit

Permalink
Update systemctl en/disable to start/stop service (#12100)
Browse files Browse the repository at this point in the history
If there is a combination of `systemctl` commands where in one you are
enabling it and in another you are starting it, that can be done in one
single command with an additional flag called `--now`. This commit
changes those two command steps in docs to one command.

The help of systemctl shows the following explanation of `--now`:

```
Start or stop unit in addition to enabling or disabling it
```

Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com>
  • Loading branch information
surajssd authored and k8s-ci-robot committed Jan 28, 2019
1 parent 5b2d835 commit a0cf7eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ KUBE_MASTER="--master=http://fed-master:8080"
systemctl mask firewalld.service
systemctl stop firewalld.service

systemctl disable iptables.service
systemctl stop iptables.service
systemctl disable --now iptables.service
```

**Configure the Kubernetes services on the master.**
Expand Down Expand Up @@ -97,8 +96,7 @@ ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"

```shell
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl enable --now $SERVICES
systemctl status $SERVICES
done
```
Expand Down Expand Up @@ -146,8 +144,7 @@ current-context: kubelet-context
```shell
for SERVICES in kube-proxy kubelet docker; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl enable --now $SERVICES
systemctl status $SERVICES
done
```
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/setup/independent/install-kubeadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

systemctl enable kubelet && systemctl start kubelet
systemctl enable --now kubelet
```

**Note:**
Expand Down Expand Up @@ -210,7 +210,7 @@ curl -sSL "https://raw.githubusercontent.com/kubernetes/kubernetes/${RELEASE}/bu
Enable and start `kubelet`:
```bash
systemctl enable kubelet && systemctl start kubelet
systemctl enable --now kubelet
```
{{% /tab %}}
{{< /tabs >}}
Expand Down

0 comments on commit a0cf7eb

Please sign in to comment.