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

Implement ipfs shutdown command #3884

Merged
merged 1 commit into from
May 18, 2017
Merged

Implement ipfs shutdown command #3884

merged 1 commit into from
May 18, 2017

Conversation

whyrusleeping
Copy link
Member

License: MIT
Signed-off-by: Jeromy [email protected]

@whyrusleeping whyrusleeping added the status/in-progress In progress label Apr 28, 2017
@whyrusleeping whyrusleeping requested a review from kevina April 28, 2017 02:20
@whyrusleeping whyrusleeping assigned ghost and Kubuxu Apr 28, 2017
@whyrusleeping whyrusleeping requested review from a user and Kubuxu April 28, 2017 02:20
@whyrusleeping whyrusleeping unassigned ghost and Kubuxu Apr 28, 2017
@kevina
Copy link
Contributor

kevina commented Apr 28, 2017

@whyrusleeping is there a reason this is a top-level command:

  ipfs daemon start
  ipfs daemon stop

makes a lot more sense to me, for backwards comparability ipfs daemon can alias to ipfs daemon start

Copy link
Contributor

@kevina kevina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make sure that this works in offline mode.

return
}

if !nd.OnlineMode() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure but I don't think this works when the daemon is started with the --offline flag.

test_expect_success "daemon no longer running" '
test_expect_code 1 kill -0 $IPFS_PID
'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also test the daemon when started with the --offline flag.

When I added the test it failed.

@whyrusleeping
Copy link
Member Author

Its a top level command because its rather difficult to make a command be a subcommand of the daemon command. I tried that at first and it would have required me to start refactoring things.

@whyrusleeping
Copy link
Member Author

@kevina made it work with --offline. Needed to use the LocalMode check instead of the OnlineMode one

Copy link
Contributor

@kevina kevina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM now.

I would prefer "ipfs daemon stop", but from IRC @whyrusleeping told me that would be difficult due to the special nature of the "daemon" command.

@kevina
Copy link
Contributor

kevina commented Apr 28, 2017

BTW @whyrusleeping codeclimate is failing:

exported var DaemonShutdownCmd should have comment or be unexported

@Kubuxu
Copy link
Member

Kubuxu commented Apr 28, 2017

Is there any reason to export this command definition.,w:x

@whyrusleeping
Copy link
Member Author

Yeah, probably no reason to export it

Copy link
Member

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test failure: need to add polling with timeout for the check that daemon died

License: MIT
Signed-off-by: Jeromy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants