Ghost: Fix the "Systemd process manager has not been set up or is corrupted" error - Guide #1
Discover how to fix the "Systemd process manager has not been set up or is corrupted" error with Ghost
I tried earlier today to update a couple of Ghost instances I run on a DigitalOcean droplet. I routinely update these instances, and I've never had any major issue — until today. On one of these instances, I got the following error when ghost update
tried to restart Ghost:
Systemd process manager has not been set up or is corrupted
The CLI suggested running ghost setup linux-user systemd
as a possible fix, but it didn't work. When trying to run the suggested command, I got the following message:
Systemd service has already been set up. Skipping Systemd setup
Running ghost doctor
wasn't helpful either.
Browsing the official Ghost forum wasn't super helpful, as most of the topics where somebody reported such an issue end by the person either giving no update (so we don't know if they managed to fix it or not) and/or saying they fixed it by reinstalling Ghost. Reinstalling Ghost was not an option for me, so I kept looking.
I rebooted the droplet and Ghost restarted — but it gave me a “Bad gateway” error. Which was odd considering that running ghost ls
gave no warnings. The instance was indeed running — but bizarrely.
I suspected the issue had something to do with permissions. Yesterday, I manually manipulated Ghost files — I was trying to fix was I thought was a bug, but it was just redirections.yaml
behaving “normally”. I ran ls -lha
within Ghost folder and compared it to what I got on the folder of another Ghost instance. Tada, I found some differences.
On the screenshot below, (2) and (3) were owned by ghuser
instead of ghost
and root
respectively.
I ran sudo chown -R ghost:ghost content
and sudo chown -R root:root system
to change the ownership of these two folders to match what I had in the other, working instance. I then tried a ghost restart
and this time, it worked: Ghost was able to restart.
Here's the text output of the permissions you're supposed to have:
ghuser@server:/var/www/www.example.com$ ls -lha
total 6.1M
drwxrwxr-x 6 ghuser ghuser 4.0K Aug 16 12:16 .
drwxr-xr-x 30 root root 4.0K Aug 15 10:04 ..
-rw-rw-r-- 1 ghuser ghuser 193 Aug 16 12:16 .ghost-cli
drwxrwxr-x 2 ghuser ghuser 4.0K May 24 11:26 backup
-rw-rw-r-- 1 ghuser ghuser 6.1M May 24 11:26 backup-from-v4.48.0-on-2022-05-24-09-25-53.zip
-rw-rw-r-- 1 ghuser ghuser 776 Aug 16 12:16 config.production.json
drwxrwxr-x 11 ghost ghost 4.0K Mar 17 17:45 content
lrwxrwxrwx 1 ghuser ghuser 34 Aug 16 12:16 current -> /var/www/www.example.com/versions/5.9.4
drwxr-xr-x 3 root root 4.0K Mar 17 17:46 system
drwxrwxr-x 4 ghuser ghuser 4.0K Aug 16 12:16 versions
After correcting the ownership of these two folders, I was able to successfully 1) restart the instance 2) update to Ghost 5.9.4
. Problem fixed!
I'm not saying the Systemd process manager has not been set up or is corrupted
error is always caused by a permission issue, but at the very least you're now aware that this is a possibility.
Last but not least, here are two blog posts that gave me some pointers and may be interesting to read if you still can't fix the error (if you can't read the language, me neither; Safari built-in translator tool was good enough to give me a rough understanding of what was written):