30 lines
816 B
Desktop File
30 lines
816 B
Desktop File
[Unit]
|
|
Description=Smail 邮件服务
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=smail
|
|
Group=smail
|
|
# 运行环境仅由 root 可读写的独立文件提供,避免在 unit 中混入部署环境配置。
|
|
EnvironmentFile=/etc/smail/smail.env
|
|
WorkingDirectory=/opt/smail
|
|
ExecStart=/opt/smail/smail
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
RuntimeDirectory=smail
|
|
RuntimeDirectoryMode=0750
|
|
# 目录由 smail 进程拥有,允许主服务创建受保护的本机控制套接字。
|
|
|
|
NoNewPrivileges=true
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
PrivateTmp=true
|
|
ProtectHome=true
|
|
ProtectSystem=full
|
|
ReadWritePaths=/opt/smail/config /opt/smail/data /opt/smail/ssl /opt/smail/log -/opt/smail/plugins /run/smail
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|