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?
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.
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”…
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.
thank you.
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 /lib/systemd/system/ipfs.service:
[Unit]
Description=IPFS daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/ipfs daemon
User=*put your own user here*
Group=*put your own group here*
[Install]
WantedBy=multi-user.target
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: