How to fix a broken ghost CMS systemd service?

Hey guys!

Hope you are doing great.

Lately I’ve been thinking about using Ghost instead of Wordpress for a blog. The editor is much faster compared to gutenberg and you know, ghost has auto image optimizations, integrated SEO and a bunch of really great features.

My issue however is probably my fault. I was changing some settings at config prod json, and after running a “ghost restart” the service doesn’t restart anymore:

If I try to run ghost setup linux-user systemd, this is what I receive:

I tried to fully delete the systemd service with these commands:

systemctl stop ghost_blog-speedyour-day
systemctl disable  ghost_blog-speedyour-day
rm /etc/systemd/system/ghost_blog-speedyour-day
rm /usr/lib/systemd/system/ghost_blog-speedyour-day
systemctl daemon-reload
systemctl reset-failed

But unfortunately, they didn’t help.

I’am able to start my block with “ghost run” but not with ghost start. The service “ghost_blog-speedyour-day” still exists.

If I try to enable it: systemctl enable ghost_blog-speedyour-day --now

I still can’t manage it with ghost cli.

Ghost doctor says this:


To be honest, I don’t understand much about systemd. Do you guys know any way to create the service again?

Thanks!

1 Like

Forgot to mention that, but the changes at the config file were related to mail. I just changed it from direct to smtp. I tried to return to direct, but no results. I think it’s unrelated with config file anyway since ghost doctor isn’t saying that it’s config fault

Welcome, @aquasp.

Have you tried ghost setup systemd again?

Can you confirm that Ghost was running before changing production.json.conf, and share the file with password etc. redacted.

1 Like

Hey, thanks for your reply!

It says that systemd setup was already done :disappointed:

This is my current:

  GNU nano 4.8                                                                                   config.production.json                                                                                              
{
  "url": "https://myblog.com",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost-462",
      "password": "mypass",
      "database": "public_html_prod"
    }
  },
"mail": {
  "transport": "direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/home/blogspeed/public_html/content"
  }
}

Ok, I think I’m giving up about systemd lol hehehe, always hated him…

Either way, if you have a issue like me and can’t fix systemd, just change to local:

ghost config --process local
ghost restart

Easier, simpler and more stable IMO. Hope Ghost keeps supporting non systemd alternatives

@mjw I know that you are probably busy, bust just wanted to tag you to show the “solution” that I found hehe.

I found a even better solution!

ghost config --process local
ghost restart
ghost config --process systemd
ghost doctor
(now fix any warning that ghost doctor says)
ghost restart

It’s all good now!