Q1:after I run “ipfs daemon > ./test.txt &” on linux, it seems the ipfs process be shutdown automatcilly after a while, maybe one day, maybe half a day. Is there any solutions to this problem?
Q2:how to run ipfs damon backgroundly on windows?
Q1: I have ipfs running on one of my nodes for weeks at a time without issues (interrupted only by server reboots following patch installations), so it’s probably not a general issue. I think troubleshooting this is going to require some additional information.
If you can capture some debugging information using
ipfs --debug daemon &> ./debug.txt it might help show what’s happening leading up to the process crash.
edit: I was just thinking that the
--debug flag may generate a lot of data over a day. The output from
ipfs daemon &> ./debug.txt might be sufficient.
Q2: There are some ideas for how to do this with go-ipfs in this GitHub issue. FWIW it seems to be much easier to do on Linux.
tnx for ur detailed reply. but I still have some questions.
I ran “ipfs --debug daemon &> ./debug.txt” on linux, but I couldnt find debug.txt in the file of “go-ipfs” and it showed all the process information in the command line. So I ran “ipfs daemon & > ./debug.txt”,but I also couldnt find “debug.txt”…
If you don’t see any output from the following command I’m guessing there’s something else wrong.
`ipfs --debug daemon &> ./debug.txt &`;sleep 5;ipfs shutdown;cat ./debug.txt
What this does:
- Starts the ipfs daemon in the background with logging to
- waits for 5 seconds to give it time for some output to be generated
- shuts down the ipfs daemon
- spits out contents of
I really appreciate ur help. the ipfs seems running normally.tnx
Hi，it seems that the ipfs shutdown automatically…here is the screenshot of debug.txt
pls help me to resolve the problem. btw,I used “ipfs --debug daemon &> ./debug.txt &” to run ipfs online.
What was happening on the system when the process shut down? Did you log out of the machine, or did the machine go to sleep? Were you actively using it?
What you posted looks like what I see when I intentionally kill the daemon using CTRL+C; it doesn’t look like a crash from your screenshot. I’m guessing something is intentionally telling the ipfs daemon process to stop.
I used XShell to operate the server. I found that when I close the xshell which means I lose the connection to server, the ipfs shutdow automatically… is there anyway to run ipfs eternally?
It depends on your linux distribution’s init system. I personally use Ubuntu 16.04 server and have a custom systemd service created for ipfs at
User=*put your own user here*
Group=*put your own group here*
This assumes that you’ve installed ipfs to
/usr/local/bin/ipfs, but if the executable is located somewhere else then you can update the path in the ipfs.service file.
After creating the service file I then configured the systemd service to automatically start by running the following commands:
sudo systemctl enable ipfs.service
sudo systemctl start ipfs.service
This should start the ipfs daemon in the background on boot and allow it to run without you needing to be connected.
This is very similar to the systemd example in the documentation, but if your distribution uses a different init system there are other examples here: https://github.com/ipfs/examples/tree/master/examples/init