0

Is there unit setting I can change so a service will stay stopped after reboot if it was stopped before reboot?

Currently service starts with OS startup even if it was stopped

CentOS9

Boppity Bop
  • 752
  • 3
  • 11
  • 34

1 Answers1

0
systemctl disable --now whatever.service

Will remove the unit from targets, preventing start at boot. --now will also stop it.

Default enabled state of a unit can be set in a couple ways. By administrator or distro policy, see systemd.preset Or, by editing the unit (systemctl edit whatever.service) and changing the Install section.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • 1
    This will however always prevent the start, regardless of the state prior to the boot. – Gerald Schneider Apr 25 '22 at 06:24
  • I cant find anything relevant on `install` section. all the copy-pasted *blogs* just use WantedBy and may be CreatedBy without much of explanation. So how do I change install section? – Boppity Bop Apr 26 '22 at 15:52