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

why do I need sudo to start ipfs daemon inside tmux? #62

Closed
SCBuergel opened this issue May 15, 2017 · 3 comments
Closed

why do I need sudo to start ipfs daemon inside tmux? #62

SCBuergel opened this issue May 15, 2017 · 3 comments

Comments

@SCBuergel
Copy link

SCBuergel commented May 15, 2017

I need some ipfs hashes to remain available over months or years, therefore I want to run the ipfs daemon on my own machine. What is the best way to achieve this?

This is what I tried:

  1. I am running a cloud-hosted VM, installed the latest ipfs and did ipfs init, all working fine.
  2. I ipfs pin the objects that I want to remain available, all still fine.
  3. I run ipfs daemon inside a tmux session to run in background and also when I log out. Since the cloud machine might reboot at times I want ipfs daemon to run on boot. Therefore I added the following lines to /etc/rc.local
tmux new-session -d -s myipfs
tmux send -t myipfs ipfs\ daemon ENTER
exit 0

Unfortunately ipfs does not seem to be able to launch inside a tmux session - it gives me the following error:

root@xxx:~# ipfs daemon
Initializing daemon...
Adjusting current ulimit to 2048...
Successfully raised file descriptor limit to 2048.
Error: no IPFS repo found in ~/.ipfs.
please run: 'ipfs init'
root@xxx:~#

When running ipfs daemon outside of tmux all is good.

@SCBuergel
Copy link
Author

SCBuergel commented May 15, 2017

I just realized that all works well when starting the daemon via sudo ipfs daemon. This is a default Ubuntu 16.04 machine on Digital Ocean - I am anyway root already and dont understand why this is required.

@SCBuergel SCBuergel changed the title how do I start ipfs daemon inside tmux? why do I need sudo to start ipfs daemon inside tmux? May 15, 2017
@ghost
Copy link

ghost commented May 15, 2017

It just can't find the repo, probably your session isn't setup correctly and $HOME points who-knows-where. What does echo $HOME print?

We discourage running go-ipfs as root for security reasons -- only run things as root if you know what you're doing. (This applies to any software, not just go-ipfs.)

@flyingzumwalt
Copy link
Contributor

flyingzumwalt commented May 23, 2017

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