Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

edward to support "service start command" #152

Open
johnzhanghua opened this issue Apr 5, 2018 · 4 comments
Open

edward to support "service start command" #152

johnzhanghua opened this issue Apr 5, 2018 · 4 comments

Comments

@johnzhanghua
Copy link

Hi,

I am using the json below to start the mongodb,

"services": [ { "name": "mongo", "commands": { "launch": "sudo service mongod start", "stop" : "sudo service mongod stop" }, "launch_checks": null, "requiresSudo" : true, "watch": { "include": [ "mongo" ] } } ]

As as I run edward start mongo, I got the following error:

mongo > Start: [Failed] (176.66ms)
runner process exited
Cleanup > mongo > Stop: [Failed] (54.025µs)
open /proc/8592: no such file or directory
Error: runner process exited

It looks edward is expecting to check the pid 8592, but this pid could be already exited.

But ps -ef |grep mongo, shows the mongodb service is running.

mongodb 8649 1 0 16:15 ? 00:00:05 /usr/bin/mongod --config /etc/mongod.conf

Thanks,
John

@theothertomelliott
Copy link
Contributor

Because the call to service start is launching a daemon, it won't be opening a port itself. By default, Edward will expect a port to be opened before the process exits.

If you run:
sudo service mongod start

At the command line, is there any output that indicates that mongodb has started successfully? If so, you can use that in a launch check: http://engblog.yext.com/edward/projectconfig/#detecting-successful-launch

@johnzhanghua
Copy link
Author

Thank you @theothertomelliott . I think I can use the port check to verify.

@theothertomelliott
Copy link
Contributor

Great, let me know if that works out ok.

Which platform are you running on? We could also look into a backend to make it eaiser to start daemons like this in the future.

@johnzhanghua
Copy link
Author

johnzhanghua commented Apr 9, 2018

I am running on ubuntu 16.04, the port check not working. The config I'm using is :
"name": "mongo", "commands": { "launch": "sudo service mongod start", "stop" : "sudo service mongod stop" }, "launch_checks": { "ports": [27017] }, "requiresSudo" : true, "watch": { "include": [ "mongo" ] }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants