#!/bin/sh

piddir="/var/run/netdata/netdata.pid"
pidfile="${piddir}/netdata.pid"

command="/usr/bin/netdata"
command_args="-P ${pidfile} -D"

[ ! -d "${piddir}" ] && mkdir -p "${piddir}"
chown -R netdata "${piddir}"

exec ${command} ${command_args}
