# How tell systemd to reload an updated systemd service file?

**URL:** <https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114>\
**Category:** Rocky Linux Help & Support\
**Created:** [July 14, 2025, 2:33pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114 "2025-07-14T14:33:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ioplex](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@ioplex](https://forums.rockylinux.org/u/ioplex)\
**Post date:** [July 14, 2025, 2:33pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114/1 "2025-07-14T14:33:15Z")

</div>

I created a systemd service on Rocky 9.5 but it had a typo in it:

```auto
# systemctl status keycloak
○ keycloak.service - keycloak-26.3.1
     Loaded: loaded (/etc/systemd/system/keycloak.service; disabled; preset: disabled)
     Active: inactive (dead)

systemd[1]: /etc/systemd/system/keycloak.service:14: Unknown key name 'ExexStop' in sec>

```

So I corrected the typo (ExexStop → ExecStop):

```auto
# cat /etc/systemd/system/keycloak.service 
[Unit]
Description=keycloak-26.3.1
After=network.target

[Service]
SuccessExitStatus=143
User=kcloak
Group=kcloak
Type=forking
WorkingDirectory=/opt/kcloak/keycloak-26.3.1
StandardOutput=append:/opt/kcloak/keycloak-stdout.txt
StandardError=append:/opt/kcloak/keycloak-stderr.txt
ExecStart=/opt/kcloak/keycloak-26.3.1/run.sh
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

```

and did a daemon-reload:

```auto
# systemctl daemon-reload

```

but to no effect. The typo persists:

```auto
# systemctl status keycloak
○ keycloak.service - keycloak-26.3.1
     Loaded: loaded (/etc/systemd/system/keycloak.service; disabled; preset: disabled)
     Active: inactive (dead)

systemd[1]: /etc/systemd/system/keycloak.service:14: Unknown key name 'ExexStop' in sec>

```

I even removed the file entirely, did a daemon-reload

```auto
# systemctl daemon-reload 
# systemctl status keycloak
Unit keycloak.service could not be found.

```

and then re-installed the file but again, it’s still using the old file content and generating the same error.

How do I get systemd to see the updated .service control file?

---

<div class="post-metadata">

**Author:** ![tjdoyle](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/tjdoyle/32/500_2.png) [@tjdoyle](https://forums.rockylinux.org/u/tjdoyle)\
**Post date:** [July 14, 2025, 3:00pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114/2 "2025-07-14T15:00:00Z")

</div>

Hi,

Have you tried:-

`systemctl restart keycloak`

Regards Tom.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [July 14, 2025, 3:06pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114/3 "2025-07-14T15:06:04Z")

</div>

Changing the file and a daemon-reload should be enough. If the file isn’t updating correctly, perhaps there is another keycloak.service file on the server?

```auto
find / -iname keycloak.service

```

or perhaps there is a `/etc/systemd/system/keycloak.service.d/override.conf` if someone has used something like `systemctl edit keycloak.service`.

---

<div class="post-metadata">

**Author:** ![ioplex](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@ioplex](https://forums.rockylinux.org/u/ioplex)\
**Post date:** [July 14, 2025, 6:32pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114/4 "2025-07-14T18:32:36Z")

</div>

This particular system is very stock, virtually unused and when it is, only by me.

```auto
# find . -path ./mnt -prune -o -print | grep keycloak.service
./root/keycloak.service
./opt/kcloak/keycloak-26.3.1/lib/lib/main/org.keycloak.keycloak-services-26.3.1.jar
# rpm -qa | grep keycloak
<no results>
# ps fax | grep systemd
      1 ? Ss 0:05 /usr/lib/systemd/systemd rhgb --switched-root --system --deserialize 31
    641 ? Ss 0:02 /usr/lib/systemd/systemd-journald
    655 ? Ss 0:00 /usr/lib/systemd/systemd-udevd
    807 ? Ss 0:00 /usr/lib/systemd/systemd-logind
 322406 pts/1 S+ 0:00 \_ grep --color=auto systemd
   2433 ? Ssl 0:11 /usr/sbin/automount --systemd-service --dont-check-daemon
  83421 ? Ss 0:00 /usr/lib/systemd/systemd --user
 312508 ? Ss 0:00 /usr/lib/systemd/systemd --user
 314186 ? Ss 0:00 /usr/lib/systemd/systemd --user
 322379 ? Ss 0:00 /usr/lib/systemd/systemd-hostnamed
# systemctl daemon-reload
# ps fax | grep systemd
      1 ? Ss 0:05 /usr/lib/systemd/systemd rhgb --switched-root --system --deserialize 31
    641 ? Ss 0:02 /usr/lib/systemd/systemd-journald
    655 ? Ss 0:00 /usr/lib/systemd/systemd-udevd
    807 ? Ss 0:00 /usr/lib/systemd/systemd-logind
 322464 pts/1 S+ 0:00 \_ grep --color=auto systemd
   2433 ? Ssl 0:11 /usr/sbin/automount --systemd-service --dont-check-daemon
  83421 ? Ss 0:00 /usr/lib/systemd/systemd --user
 312508 ? Ss 0:00 /usr/lib/systemd/systemd --user
 314186 ? Ss 0:00 /usr/lib/systemd/systemd --user
# systemctl status keycloak
× keycloak.service - keycloak-26.3.1
     Loaded: loaded (/etc/systemd/system/keycloak.service; disabled; preset: disabled)
     Active: failed [because of incorrect Type=forking]
# shutdown -r now 

```

…

```auto
# systemctl status keycloak
○ keycloak.service - keycloak-26.3.1
     Loaded: loaded (/etc/systemd/system/keycloak.service; disabled; preset: disabled)
     Active: inactive (dead)

```

Now fixed unrelated issue `Type=forking` to `Type=simple` and:

```auto
# systemctl daemon-reload
# systemctl stop keycloak
# systemctl start keycloak
# systemctl status keycloak
● keycloak.service - keycloak-26.3.1
     Loaded: loaded (/etc/systemd/system/keycloak.service; disabled; preset: disabled)
     Active: active (running) since Mon 2025-07-14 14:12:16 EDT; 3s ago 
   Main PID: 2411 (run.sh)
      Tasks: 33 (limit: 22779)
     Memory: 263.6M
        CPU: 9.055s
     CGroup: /system.slice/keycloak.service
             ├─2411 /bin/sh /opt/kcloak/keycloak-26.3.1/run.sh
             └─2412 java -Dkc.config.built=true -Djava.util.concurrent.ForkJoinPool.common.threadFactory=io.qua>

systemd[1]: Started keycloak-26.3.1.

```

So rebooting seems to have fixed it.

But maybe there’s a sporatic bug lurking in the systemd services caching.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [September 12, 2025, 6:33pm UTC](https://forums.rockylinux.org/t/how-tell-systemd-to-reload-an-updated-systemd-service-file/19114/5 "2025-09-12T18:33:17Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
