1

Fresh install, trying to run ghost start I get the following error:

Debug Information:
    OS: Raspbian, v8.0
    Node Version: v6.13.0
    Ghost-CLI Version: 1.5.2
    Environment: production
    Command: 'ghost start'
An error occurred.
Message: 'Command failed: /bin/sh -c systemctl is-active ghost_blog-dev

unknown
'

Stack: Error: Command failed: /bin/sh -c systemctl is-active ghost_blog-dev

unknown

    at makeError (/usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:169:9)
    at module.exports.sync (/usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:338:15)
    at handleShell (/usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:116:9)
    at Function.module.exports.shellSync (/usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:361:43)
    at SystemdProcessManager.isRunning (/usr/lib/node_modules/ghost-cli/extensions/systemd/systemd.js:88:19)
    at Instance.running (/usr/lib/node_modules/ghost-cli/lib/instance.js:120:34)
    at StartCommand.run (/usr/lib/node_modules/ghost-cli/lib/commands/start.js:28:22)
    at precheck.then (/usr/lib/node_modules/ghost-cli/lib/command.js:159:52)
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:613:11)
    at run (bootstrap_node.js:387:7)
    at startup (bootstrap_node.js:153:9)
    at bootstrap_node.js:500:3
Code: 3

If I manually run the command that is says failed it seems to execute without error though I am not sure what it does. I assume it has something to do with checking with nginx if ghost has actually started or not.

Any suggestions would be very helpful! Thank you!

Path
  • 11
  • 3
  • What does running `systemctl is-active ghost_blog-dev` produce? – Slava Knyazev Feb 18 '18 at 20:06
  • I ran it as `sh -c systemctl is-active ghost_blog-dev` originally which seems to produce a list of services such as cron, nginx, smbd, ssh, etc... and their current running status as well as some information about connected devices. I tried it again now without the `sh -c` at the beginning and that results simply with: `unknown` which I assume means it didn't find "ghost_blog-dev" which makes sense because it failed to start. – Path Feb 18 '18 at 22:48
  • I managed to get ghost to start by running `sudo systemctl start ghost_blog-dev.service` and then `ghost start` which gives an error: `Ghost is already running. Use ghost ls to see details`. but starts anyway at this point. After that I can call `ghost restart` and it will restart properly but if I reboot the system it does not start again unless I do the same thing again. Any ideas? Thanks! – Path Feb 23 '18 at 17:04
  • Had the same problem and was also able to start manually with omitting `sh -c`. Thanks! Please let me know if you have more info about this problem. – mohoff Mar 08 '18 at 14:43

1 Answers1

2

I faced with the same problem. You should add your service file to etc directory also as symbolic link using the following command:

sudo ln -sf /var/www/html/your-blog/system/files/ghost_blog-yourblog.service /etc/systemd/system/ghost_blog-yourblog.service

After adding this, you should execute the following commands:

sudo systemctl stop ghost_blog-yourblog.service
sudo systemctl start ghost_blog-yourblog.service

Then, I hope you'll see 'active' result for is-active command.

merttasci
  • 21
  • 2
  • save my time! I try to install ghost on centos:`OS: CentOS Linux, v7 Node Version: v12.10.0 Ghost-CLI Version: 1.13.1 Environment: production Command: 'ghost install` got this error. maybe ghost-cli create symbolic link on the path `/lib/systemd/system` is not enough. after add ln on path `/etc/systemd/system`. ghost install pass! – GeekLei Dec 29 '19 at 12:23
  • I also needed to do `ghost setup linux-user` & `ghost setup systemd` prior to the above steps, just FYI – Matt Rowles Mar 23 '20 at 02:16