[Unit] Description=MinIO AIStor Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] Type=notify WorkingDirectory=/usr/local User=minio-user Group=minio-user ProtectProc=invisible # Allow binding to privileged ports (< 1024) without running as root # CAP_SYS_ADMIN + CAP_DAC_OVERRIDE enable S.M.A.R.T. disk health monitoring # CAP_SYS_RESOURCE lets the AIStor Files gateway, which MinIO AIStor starts as a # child process, mark itself as an I/O flusher AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_RESOURCE # The service holds the capabilities above and can never gain another one, not # even through a setuid or file-capability binary. CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_RESOURCE NoNewPrivileges=yes # CAP_DAC_OVERRIDE bypasses file permissions, so the system's own files are kept # out of its reach: /usr, /boot and /etc are read-only for the service, except # the binary's directory, which an in-place update replaces, and /etc/minio. # Credentials, sudo rules and users' crontabs are not visible. CAP_SYS_ADMIN # could remount those paths, so the service may not mount or create namespaces. ProtectSystem=full ReadWritePaths=-/usr/local/bin -/etc/minio # Block devices are read-only too, so the service cannot write a disk directly # and change the files on it. S.M.A.R.T. opens them read-only; character # devices (NVMe controllers, RDMA, GPUs) stay read-write. DeviceAllow=block-* r DeviceAllow=char-* rw InaccessiblePaths=-/etc/shadow -/etc/gshadow -/etc/sudoers -/etc/sudoers.d -/root -/var/spool/cron SystemCallFilter=~@mount @module @reboot @swap @obsolete @cpu-emulation SystemCallErrorNumber=EPERM RestrictNamespaces=yes RestrictSUIDSGID=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectKernelLogs=yes ProtectControlGroups=yes ProtectClock=yes ProtectHostname=yes LockPersonality=yes RestrictRealtime=yes # RDMA pins its buffers in memory. Without a limit it needs neither root nor # CAP_IPC_LOCK, so the same service file serves nodes with and without RDMA. LimitMEMLOCK=infinity EnvironmentFile=-/etc/default/minio ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES # Reload via SIGHUP to refresh runtime state without restarting. Refreshes: # - Server pool configuration (hot-reload of the `pools` array for cluster expansion) # - License file # - TLS certificate directory (full rescan to pick up added or removed cert subdirectories) ExecReload=/bin/kill -SIGHUP $MAINPID # Let systemd restart this service always Restart=always # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=1048576 # Turn-off memory accounting by systemd, which is buggy. MemoryAccounting=no # Specifies the maximum number of threads this process can create TasksMax=infinity # Disable timeout logic and wait until process is stopped TimeoutSec=infinity # Disable killing of MinIO by the kernel's OOM killer OOMScoreAdjust=-1000 SendSIGKILL=no # Send SIGTERM to MinIO AIStor only: it stops the AIStor Files gateway it started # and waits for it to exit, so the gateway shuts down in order KillMode=mixed [Install] WantedBy=multi-user.target