mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-01 23:34:20 +08:00
* 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
61 lines
1.5 KiB
Desktop File
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
|