Skip to content

Commit

Permalink
TIL: systemctl mask - prevent service from ever starting again
Browse files Browse the repository at this point in the history
  • Loading branch information
pew committed Jul 26, 2024
1 parent 443c33a commit 17b59c9
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion man/systemd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
date created: Monday, April 22nd 2019, 6:51:17 pm
date modified: Saturday, June 29th 2024, 9:34:55 am
date modified: Friday, July 26th 2024, 9:57:56 am
tags:
- systemd
- systemctl
Expand Down Expand Up @@ -206,6 +206,30 @@ journalctl -u your-name.service
journalctl -f -u your-name.service
```

### disable / mask service, prevent from starting

using *disable* stops the service from starting automatically, but it can be started manually. *mask* prevents the service from being started at all by creating a symlink to `/dev/null`

**disable a service from starting automatically:**

it can be started manually, for example by NetworkManager

```shell
systemctl disable wpa_supplicant.service
```

**prevent service from being started at all:**

```shell
systemctl mask wpa_supplicant.service
```

the output will also tell you that the service has been linked to `/dev/null`:

```shell
Created symlink /etc/systemd/system/wpa_supplicant.service → /dev/null.
```

### list active services

the service might be *active*, but exited already since it was just initializing or checking something
Expand Down

0 comments on commit 17b59c9

Please sign in to comment.