fix: systemd configuration (#1097)

1. Tune some security directives.
2. Fix the flags file that mistakenly configured dragonfly to store its dump files into /run (tmpfs).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2023-04-16 06:41:02 -07:00 committed by GitHub
parent 74e94ef9bb
commit e17fb41dee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -1,4 +1,4 @@
--pidfile=/var/run/dragonfly/dragonfly.pid --pidfile=/var/run/dragonfly/dragonfly.pid
--log_dir=/var/log/dragonfly --log_dir=/var/log/dragonfly
--dir=/var/run/dragonfly --dir=/var/lib/dragonfly
--version_check=true --version_check=true

View file

@ -5,9 +5,10 @@ Documentation=
[Service] [Service]
Type=simple Type=simple
EnvironmentFile=-/etc/dragonfly/environment
ExecStart=/usr/bin/dragonfly --flagfile=/etc/dragonfly/dragonfly.conf ExecStart=/usr/bin/dragonfly --flagfile=/etc/dragonfly/dragonfly.conf
PIDFile=/var/run/dragonfly/dragonfly.pid PIDFile=/var/run/dragonfly/dragonfly.pid
TimeoutStopSec=0 TimeoutStopSec=infinity
Restart=always Restart=always
User=dfly User=dfly
Group=dfly Group=dfly
@ -16,10 +17,11 @@ RuntimeDirectoryMode=2755
UMask=007 UMask=007
PrivateTmp=yes PrivateTmp=yes
LimitNOFILE=65535 LimitNOFILE=262144
PrivateDevices=yes PrivateDevices=yes
ProtectHome=yes ProtectHome=yes
ReadOnlyDirectories=/ ProtectSystem=full
ReadWritePaths=-/var/lib/dragonfly ReadWritePaths=-/var/lib/dragonfly
ReadWritePaths=-/var/log/dragonfly ReadWritePaths=-/var/log/dragonfly
ReadWritePaths=-/var/run/dragonfly ReadWritePaths=-/var/run/dragonfly
@ -34,8 +36,7 @@ RestrictRealtime=true
RestrictNamespaces=true RestrictNamespaces=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
ProtectSystem=true
ReadWriteDirectories=-/etc/dragonfly
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target