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:
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
I know this is an old post but I had this same thing happen and it was maddening. I eventually found the solution (for me) so I wanted to post it here as it’s what came up when I was searching.
This is specific to my own system: I added a new volume to my VM and moved all my sites to that volume. That seemed fine except that my systemd services for the ghost sites disappeared.
ghost doctor revealed no issues.
ghost setup linux-user systemd resulted in the message Systemd service has already been set up. Skipping Systemd setup.
I could re-enable the service by doing systemctl enable ghost_{site-name} but then after a reboot the service would be gone.
Looking in /etc/systemd/system I saw that the .service files for my Ghost sites were symlinks to files in my ghost installation. This is a perfectly reasonable thing to do, but systemd initializes before external volumes are mounted. Since that volume wasn’t mounted yet, those files were essentially empty, and nothing happened. Also, adding Requires= and After= lines to the .service file, the normal way to delay a service starting until after a volume is mounted, won’t work because the .service file itself appears as empty if the volume is not mounted.
I think there must be a way to tell systemd to wait to load that file but I don’t know what it is. (I’m looking at those .wants and .requires directories).
For the moment my fix is:
Copy the actual .service files from{ghost_root}/system/files/ghost_{site-name}.service into /etc/systemd/system
Call it a day.
Sure, if a Ghost version update changes those files the changes won’t be reflected. But I’m guessing that doesn’t get changed often. In the meantime I have time to look deeper into systemd for a better fix.