-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
systemd support #1430
Comments
@slang800 you probably want a systemd script, kind of like these initd scripts: |
Here's a rudimentary systemd service file that I use:
Place this in |
it would be amazing to have an "example" in http://ipfs.io/docs/examples (https://github.com/ipfs/examples) that goes over systemd, initd, and other services. (also, nice NERV avatar :) ) |
also, maybe:
this could be a |
License: MIT Signed-off-by: Sean Lang <slang800@gmail.com>
License: MIT Signed-off-by: Sean Lang <slang800@gmail.com>
The examples are somewhat poor; this one is better:
|
I have an initial PR (#5514) to add systemd and socket activation support. I'd like to avoid making the example service file too opinionated unless we provide both a system and a user service file along with instructions. |
a sample for
|
@Stebalien's #5514 mentioned above he closed, but his #6675 is now merged! See https://github.com/ipfs/go-ipfs/tree/master/misc/systemd for where the files are. |
@Ericson2314 is there a reason why you warm up this old and closed ticket? :) |
I posted here because I landed here while looking for systemd support, the information was out of date, and the situation has improved since. I figured I would by leaving a comment for future searchers, I would save them some trouble. I usually figure this is good practice (especially when it's good news). And since the issue had been updated with new information before (by an employee of Protocol Labs, no less), I figured it was deemed good practice here to. |
Thanks for pointing this out. The documentation is indeed a bit outdated and should point to the misc/systemd directory. I created a ticket for this. Feel free to add notes to it, if something is missing: |
Ubuntu 20.04.2 LTS System-Scoped/etc/systemd/system/ipfs.service [Unit]
Description=IPFS Daemon
After=network.target
[Service]
User=ubuntu
Group=ubuntu
Environment=IPFS_PATH=/home/ubuntu/.ipfs
ExecStart=/usr/local/bin/ipfs daemon --init --migrate
StandardOutput=journal
Restart=on-failure
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target sudo systemctl daemon-reload User-Scoped/home/ubuntu/.config/systemd/user/ipfs.service [Unit]
Description=IPFS Daemon
After=network.target
[Service]
User=ubuntu
Group=ubuntu
Environment=IPFS_PATH=/home/ubuntu/.ipfs
ExecStart=/usr/local/bin/ipfs daemon --init --migrate
StandardOutput=journal
Restart=on-failure
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target systemctl --user daemon-reload |
Hey @caryyu, you can find the systemd service files for go-ipfs in misc/systemd. I recommend the hardened version if you don't need FUSE. |
The IPFS documentation recommends that the daemon be ran under user-scope. The system-scope example could put your system at risk of being compromised. |
systemctl <command> ipfs
doesn't work, which makes this a pain to manage as a daemonThe text was updated successfully, but these errors were encountered: