Skip to content

Commit

Permalink
dist/debian: install capabilities.conf on postinst script
Browse files Browse the repository at this point in the history
We still has "{{^jessie}}" tag on scylla-server systemd unit file to
skip using AmbientCapabilities on Debian 8, but it does not able to work
anymore since we moved to single binary .deb package for all debian variants,
we must share same systemd unit file across all Debian variants.

To do so we need to have separated file on /etc/systemd to define
AmbientCapabilities, create the file while running postinst script only
if distribution is not Debian 8, just like we do in .rpm.

See scylladb#3344
See scylladb#3486

Signed-off-by: Takuya ASADA <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
syuu1228 authored and avikivity committed Jun 23, 2019
1 parent 46341bd commit 2135d2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions dist/common/systemd/scylla-server.service.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ OOMScoreAdjust=-950
StandardOutput=syslog
StandardError=syslog
SyslogLevelPrefix=false
{{#debian}}
{{^jessie}}
AmbientCapabilities=CAP_SYS_NICE
{{/jessie}}
{{/debian}}

[Install]
WantedBy=multi-user.target
6 changes: 6 additions & 0 deletions dist/debian/debian/scylla-server.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ mv /tmp/scylla.yaml /etc/scylla/scylla.yaml
if [[ "$ID" = "debian" && "$VERSION_ID" = "8" ]] || [[ "$ID" = "ubuntu" && "$VERSION_ID" = "14.04" ]]; then
echo "kernel.core_pattern=|/opt/scylladb/scripts/scylla_save_coredump %e %t %p" > /etc/sysctl.d/99-scylla-coredump.conf
echo "scylla ALL=(ALL) NOPASSWD: /opt/scylladb/scripts/scylla_prepare,/opt/scylladb/scripts/scylla_stop,/opt/scylladb/scripts/scylla_io_setup,/opt/scylladb/scripts/scylla-ami/scylla_ami_setup" > /etc/sudoers.d/scylla
else
mkdir -p /etc/systemd/system/scylla-server.service.d/
cat << EOS > /etc/systemd/system/scylla-server.service.d/capabilities.conf
[Service]
AmbientCapabilities=CAP_SYS_NICE
EOS
fi

if [ -d /run/systemd/system ]; then
Expand Down

0 comments on commit 2135d2a

Please sign in to comment.