Skip to content
This repository has been archived by the owner. It is now read-only.

How do I undo the ipfs daemon command? #39

Closed
Mithgol opened this issue Sep 15, 2015 · 16 comments
Closed

How do I undo the ipfs daemon command? #39

Mithgol opened this issue Sep 15, 2015 · 16 comments

Comments

@Mithgol
Copy link

Mithgol commented Sep 15, 2015

How do I shot web terminate the unixweb daemon? Is there any ipfs daemon stop to undo ipfs daemon?

@ghost
Copy link

ghost commented Sep 15, 2015

You send it Ctrl-C to terminate gracefully, and a second Ctrl-C to terminate immediately.

@jbenet
Copy link
Contributor

jbenet commented Sep 15, 2015

@Mithgol or kill $pid or kill -9 $pid

@jbenet
Copy link
Contributor

jbenet commented Sep 15, 2015

(i suppose it may be convenient to have an ipfs daemon stop or something, for scripts and so on, but not 100% convinced yet).

@Mithgol
Copy link
Author

Mithgol commented Sep 16, 2015

@jbenet Would you recommend taskkill /pid processID /f /t on Windows, or without /f, or without /t, or without both?

@ligi
Copy link

ligi commented Jun 2, 2016

+1 for ipfs daemon stop
use-case: I run the daemon via gomobile and there is no shell for kill commands or to send ctrl-c

@jbenet
Copy link
Contributor

jbenet commented Jun 4, 2016

After speaking with @ligi, it is clear that many applications will need to be able to trigger deamon to exit through the api.

i'd be in favor of a ipfs daemon stop

@ligi
Copy link

ligi commented Jun 5, 2016

that's great - would also be great to have a way to query the status of the daemon ( z.b. inactive, initializing, initialized ) - currently e.g. the initializing state is hard to detect AFAIK

@Kubuxu
Copy link

Kubuxu commented Jun 5, 2016

It is hard to detect as the peer discovery and inital connections run before API is started. There is very old issue about that: ipfs/kubo#973

Which means that you can't query daemon information until it started.

The ipfs daemon stop could be created by creating pid file inside a repo structure, it wouldn't be that hard to do.

Then, IMO, we should provided build in daemonisation of the daemon (forking mode).

@xznhj8129
Copy link

xznhj8129 commented Mar 24, 2017

Seriously, we don't have this yet? Come on...

@alexgarciac
Copy link

alexgarciac commented Mar 28, 2017

Seriously needed... ipfs daemon stop

@whyrusleeping
Copy link

whyrusleeping commented Mar 28, 2017

There are quite a bit of other things that have taken priority, I'll try and get this prioritized soon. That said, we do accept PRs ;)

@hsanjuan
Copy link
Member

hsanjuan commented Mar 29, 2017

Unless you are in a situation like ligi describes (exec-ing the daemon inside an Android app), there are multiple workarounds for this. One is using a systemd service as shown at https://github.com/ipfs/examples/tree/master/examples/init to start/stop ipfs, which will additionally also collect your logs.

@xznhj8129
Copy link

xznhj8129 commented Mar 30, 2017

...and on windows?

@hsanjuan
Copy link
Member

hsanjuan commented Mar 30, 2017

I don't use windows, but http://tweaks.com/windows/39559/kill-processes-from-command-prompt/ says you can do something like taskkill /IM ipfs. There are shell aliases or you can put it in a script called ipfsstop.cmd.

That said, I don't know if exit is handled correctly in this case or ipfs will be killed immediately. Can you test?

@noxonsu
Copy link

noxonsu commented Apr 8, 2017

taskkill /IM ipfs.exe /f

this work for me. But what about /Users/.../repo.lock file? How to "unlock" him? I try this, but not working

function getUserHome() {
 return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
}

if (fs.existsSync(getUserHome()+"/.ipfs/repo.lock")) {
fs.unlink(getUserHome()+"/.ipfs/repo.lock");
} 

@madavieb
Copy link

madavieb commented May 23, 2017

This issue has been moved to https://discuss.ipfs.io/t/how-do-i-undo-the-ipfs-daemon-command/443.

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

10 participants