Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs daemon shutdown command #3034

Closed
whyrusleeping opened this issue Aug 3, 2016 · 7 comments
Closed

ipfs daemon shutdown command #3034

whyrusleeping opened this issue Aug 3, 2016 · 7 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature topic/daemon + init

Comments

@whyrusleeping
Copy link
Member

It would be useful to have a command to be able to halt the daemon programmatically, either ipfs daemon stop or ipfs daemon shutdown.

Related Issues:

@whyrusleeping whyrusleeping added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue topic/daemon + init exp/expert Having worked on the specific codebase is important labels Aug 3, 2016
marionzualo added a commit to marionzualo/www that referenced this issue Aug 23, 2016
Assumes the IPFS daemon is already running locally. Probably this won't
be needed when start/shutdown commands are added to the daemon
ipfs/kubo#3034

Also assumes an IPFS docker container is running on the remote node. The
image I am using is https://hub.docker.com/r/ipfs/go-ipfs/
marionzualo added a commit to marionzualo/www that referenced this issue Aug 23, 2016
Assumes the IPFS daemon is already running locally. Probably this won't
be needed when start/shutdown commands are added to the daemon
ipfs/kubo#3034

Also assumes an IPFS docker container is running on the remote node. The
image I am using is https://hub.docker.com/r/ipfs/go-ipfs/

This is run using:
REMOTE_NODE_DOMAIN="<IP_ADDR>" rake -f _plugins/ipfs_deploy.rake
@whyrusleeping
Copy link
Member Author

we have this now. ipfs shutdown

@aloknerurkar
Copy link

aloknerurkar commented Nov 26, 2019

This is not an issue, but more of a query. I am sorry if this is not the right forum for it but as its specific to this command I was hoping to get some help here.

I am working on something where I programatically start the ipfs node. I was trying to understand the shutdown code.

    Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error {

	nd, err := cmdenv.GetNode(env)
	if err != nil {
		return err
	}

	if !nd.IsDaemon {
		return cmds.Errorf(cmds.ErrClient, "daemon not running")
	}

	if err := nd.Close(); err != nil {
		log.Error("error while shutting down ipfs daemon:", err)
	}

	return nil
},

The ipfs daemon is running in a separate process. How is this able to stop the same running node? Is there some way this cmdenv is able to share memory between processes?

I might have to go much deeper in code to understand this, so if anyone knows it on the top of their head I would really appreciate it!

@Stebalien
Copy link
Member

I'd be happy to answer this question on https://discuss.ipfs.io.

@aloknerurkar
Copy link

I'd be happy to answer this question on https://discuss.ipfs.io.

Created a topic here:
https://discuss.ipfs.io/t/sharing-memory-in-ipfs-commands/6745?u=aloknerurkar

@jcomeauictx
Copy link

As of ipfs version 0.8.0-dev, ipfs shutdown works, but ipfs help doesn't show it. People like me therefore keep trying ipfs stop, ipfs quit, ipfs terminate, ...

@Stebalien
Copy link
Member

@jcomeauictx please file a new bug. It looks like this was never actually added to the help text.

@jcomeauictx
Copy link

Thanks, I'll pass for now. If I'm going to file a bug I might as well fix it and submit a pull request, and my plate is already overfull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature topic/daemon + init
Projects
None yet
Development

No branches or pull requests

4 participants