Files
rustfs/deploy/build/rustfs.service
houseme 4648de9e62 chore(deploy): refine systemd and nixos service docs (#3096)
* fix(deploy): simplify systemd service startup

* docs(deploy): add nixos systemd service example

* docs(deploy): add nixos service guide

* chore(deps): update pulsar and pyroscope

* docs(deploy): refine nixos service guidance

* fix(deploy): use explicit rustfs server entrypoint
2026-05-27 14:47:47 +00:00

61 lines
1.5 KiB
Desktop File

[Unit]
Description=RustFS Object Storage Server
Documentation=https://rustfs.com/docs/
After=network-online.target
Wants=network-online.target
# If you're using a database, you'll need to add the corresponding dependencies
# After=postgresql.service
# Requires=postgresql.service
[Service]
Type=notify
NotifyAccess=main
User=rustfs
Group=rustfs
# working directory
WorkingDirectory=/opt/rustfs
# Environment-driven startup.
# rustfs reads address, volumes, console, credentials, and other runtime settings
# from RUSTFS_* variables. See `../config/rustfs.env` for an example template.
EnvironmentFile=/etc/default/rustfs
ExecStart=/usr/local/bin/rustfs server
# service log configuration
LogsDirectory=rustfs
StandardOutput=append:/var/log/rustfs/rustfs.log
StandardError=append:/var/log/rustfs/rustfs-err.log
# resource constraints
LimitNOFILE=1048576
LimitNPROC=32768
TasksMax=infinity
# restart the policy
Restart=always
RestartSec=10s
# graceful exit configuration
# Type=notify waits for READY=1, so startup timeout must cover RustFS initialization
# plus runtime readiness checks on slower disks or cold starts.
TimeoutStartSec=120s
TimeoutStopSec=45s
# security settings
NoNewPrivileges=true
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true
ReadWritePaths=/data/rustfs /var/log/rustfs
[Install]
WantedBy=multi-user.target