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

refactor(systemd): rename to kubo #9099

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions misc/systemd/ipfs-sysusers.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# config.

[Unit]
Description=IPFS API Socket
Description=Kubo's RPC API Socket

[Socket]
Service=ipfs.service
Service=kubo.service
FileDescriptorName=io.ipfs.api
BindIPv6Only=true
ListenStream=127.0.0.1:5001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# your config.

[Unit]
Description=IPFS Gateway Socket
Description=Kubo's Gateway Socket

[Socket]
Service=ipfs.service
Service=kubo.service
FileDescriptorName=io.ipfs.gateway
BindIPv6Only=true
ListenStream=127.0.0.1:8080
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# This file will be overwritten on package upgrades, avoid customizations here.
#
# To make persistent changes, create file in
# "/etc/systemd/system/ipfs.service.d/overwrite.conf" with
# `systemctl edit ipfs.service`. This file will be parsed after this
# "/etc/systemd/system/kubo.service.d/overwrite.conf" with
# `systemctl edit kubo.service`. This file will be parsed after this
# file has been parsed.
#
# To overwrite a variable, like ExecStart you have to specify it once
# blank and a second time with a new value, like:
# ExecStart=
# ExecStart=/usr/bin/ipfs daemon --flag1 --flag2
# ExecStart=/usr/bin/kubo daemon --flag1 --flag2
#
# For more info about custom unit files see systemd.unit(5).

# This service file enables systemd-hardening features compatible with IPFS,
# This service file enables systemd-hardening features compatible with Kubo,
# while breaking compatibility with the fuse-mount function. Use this one only
# if you don't need the fuse-mount functionality.

[Unit]
Description=InterPlanetary File System (IPFS) daemon
Description=Kubo daemon for the InterPlanetary File System (IPFS)
Documentation=https://docs.ipfs.tech/
After=network.target

[Service]
# hardening
ReadWritePaths="/var/lib/ipfs/"
ReadWritePaths="/var/lib/kubo/"
RubenKelevra marked this conversation as resolved.
Show resolved Hide resolved
NoNewPrivileges=true
ProtectSystem=strict
ProtectKernelTunables=true
Expand Down Expand Up @@ -51,26 +51,26 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a custom path see docs/environment-variables.md for further documentations
#Environment=IPFS_PATH=/custom/ipfs/path
#Environment=IPFS_PATH=/custom/kubo-repo/path
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000

#don't use swap
MemorySwapMax=0

# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when
# badger is recovering) and migrations can delay startup.
# Don't timeout on startup. Opening the Kubo repo can take a long time in some cases (e.g., when
# badger is recovering).
#
# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking
# systemd dependencies deeper into go-ipfs.
# systemd dependencies deeper into Kubo.
TimeoutStartSec=infinity

Type=notify
User=ipfs
Group=ipfs
StateDirectory=ipfs
User=kubo
Group=kubo
StateDirectory=kubo
Environment=IPFS_PATH="${HOME}"
ExecStart=/usr/bin/ipfs daemon --init --migrate
ExecStart=/usr/bin/kubo daemon --enable-gc
RubenKelevra marked this conversation as resolved.
Show resolved Hide resolved
Restart=on-failure
KillSignal=SIGINT

Expand Down
3 changes: 3 additions & 0 deletions misc/systemd/kubo-sysusers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
u kubo - "Kubo daemon for ipfs" /var/lib/kubo
g kubo -
m kubo kubo
24 changes: 12 additions & 12 deletions misc/systemd/ipfs.service → misc/systemd/kubo.service
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# This file will be overwritten on package upgrades, avoid customizations here.
#
# To make persistent changes, create file in
# "/etc/systemd/system/ipfs.service.d/overwrite.conf" with
# `systemctl edit ipfs.service`. This file will be parsed after this
# "/etc/systemd/system/kubo.service.d/overwrite.conf" with
# `systemctl edit kubo.service`. This file will be parsed after this
# file has been parsed.
#
# To overwrite a variable, like ExecStart you have to specify it once
# blank and a second time with a new value, like:
# ExecStart=
# ExecStart=/usr/bin/ipfs daemon --flag1 --flag2
# ExecStart=/usr/bin/kubo daemon --flag1 --flag2
RubenKelevra marked this conversation as resolved.
Show resolved Hide resolved
#
# For more info about custom unit files see systemd.unit(5).

[Unit]
Description=InterPlanetary File System (IPFS) daemon
Description=Kubo daemon for the InterPlanetary File System (IPFS)
Documentation=https://docs.ipfs.tech/
After=network.target

Expand All @@ -22,26 +22,26 @@ After=network.target
# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a custom path see docs/environment-variables.md for further documentations
#Environment=IPFS_PATH=/custom/ipfs/path
#Environment=IPFS_PATH=/custom/kubo/path
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000

#don't use swap
MemorySwapMax=0

# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when
# badger is recovering) and migrations can delay startup.
# Don't timeout on startup. Opening the Kubo repo can take a long time in some cases (e.g., when
# badger is recovering).
#
# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking
# systemd dependencies deeper into go-ipfs.
# systemd dependencies deeper into Kubo.
TimeoutStartSec=infinity

Type=notify
User=ipfs
Group=ipfs
StateDirectory=ipfs
User=kubo
Group=kubo
StateDirectory=kubo
Environment=IPFS_PATH="${HOME}"
ExecStart=/usr/bin/ipfs daemon --init --migrate
ExecStart=/usr/bin/kubo daemon --enable-gc
Restart=on-failure
KillSignal=SIGINT

Expand Down