# scylla-server - ScyllaDB
#
# ScyllaDB

description	"ScyllaDB server"

start on runlevel [2345]
stop on runlevel [!2345]

umask 022

console log

expect stop
setuid scylla
setgid scylla
limit core unlimited unlimited
limit memlock unlimited unlimited
limit nofile 200000 200000
limit as unlimited unlimited
limit nproc 8096 8096
chdir /var/lib/scylla
env HOME=/var/lib/scylla

pre-start script
    . /etc/default/scylla-server
    export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS
    sudo /usr/lib/scylla/scylla_prepare
end script

script
    . /etc/default/scylla-server
    export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS
    exec /usr/bin/scylla $SCYLLA_ARGS
end script

post-stop script
    . /etc/default/scylla-server
    export NETWORK_MODE TAP BRIDGE ETHDRV ETHPCIID NR_HUGEPAGES USER GROUP SCYLLA_HOME SCYLLA_CONF SCYLLA_ARGS
    sudo /usr/lib/scylla/scylla_stop
end script
