]> arthur.barton.de Git - netdata.git/blobdiff - system/netdata-openrc.in
Merge pull request #705 from ciccatrix/fix-init-script
[netdata.git] / system / netdata-openrc.in
old mode 100755 (executable)
new mode 100644 (file)
index 3b747fc..5580836
@@ -1,4 +1,4 @@
-#!/sbin/runscript
+#!/sbin/openrc-run
 
 # The user netdata is configured to run as.
 # If you edit its configuration file to set a different
 : ${NETDATA_START_AFTER_SERVICES:=apache2 squid nginx mysql named opensips upsd hostapd postfix lm_sensors}
 
 extra_started_commands="getconf"
-pidfile="/run/netdata/netdata.pid"
+pidfile="/run/netdata.pid"
 command="${NETDATA_INSTALL_PATH}/usr/sbin/netdata"
 command_background="yes"
-command_args="-pidfile ${pidfile} ${NETDATA_EXTRA_ARGS}"
-start_stop_daemon_args="-u ${NETDATA_OWNER}"
+command_args="-P ${pidfile} ${NETDATA_EXTRA_ARGS}"
+# start_stop_daemon_args="-u ${NETDATA_OWNER}"
+start_stop_daemon_args=""
 
 depend() {
        use logger
@@ -36,11 +37,6 @@ depend() {
        checkpath -o ${NETDATA_OWNER} -d @localstatedir_POST@/cache/netdata /run/netdata
 }
 
-start_pre() {
-       piddir=$(dirname ${pidfile})
-       mkdir -p ${piddir}
-}
-
 start_post() {
        if [[ ! -f @sysconfdir_POST@/netdata/netdata.conf ]]; then
                ebegin "Downloading default configuration to @sysconfdir_POST@/netdata/netdata.conf"