Changeset 28948


Ignore:
Timestamp:
2011-11-11T16:46:32+01:00 (6 years ago)
Author:
nico
Message:

packages/collectd: use new service functions

Location:
packages/utils/collectd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/utils/collectd/Makefile

    r26782 r28948  
    11# 
    2 # Copyright (C) 2006-2010 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=collectd 
    1111PKG_VERSION:=4.10.2 
    12 PKG_RELEASE:=2 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
  • packages/utils/collectd/files/collectd.init

    r19887 r28948  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2006-2010 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33 
    44START=80 
    5 BINARY="/usr/sbin/collectd" 
    6 PIDFILE="/var/run/collectd.pid" 
    7 DATADIR="/var/lib/collectd" 
     5 
     6SERVICE_USE_PID=1 
    87 
    98start() { 
    10         [ -x "$BINARY" ] || exit 1 
    11         [ -d "$DATADIR" ] || mkdir -p "$DATADIR"; 
    12  
    13         rm -f $PIDFILE 
    14         start-stop-daemon -S -q -b -x $BINARY -m -p $PIDFILE -- -f 
     9        mkdir -m 0755 -p /var/lib/collectd 
     10        service_start /usr/sbin/collectd 
    1511} 
    1612 
    1713stop() { 
    18         [ -s "$PIDFILE" ] && { 
    19                 local pid="$(cat $PIDFILE)" 
    20  
    21                 start-stop-daemon -K -q -n ${BINARY##*/} -p $PIDFILE 
    22  
    23                 for i in 1 2 3 4 5; do 
    24                         kill -0 $pid 2>/dev/null || return 
    25                         sleep 1 
    26                 done 
    27         } 
     14        service_stop /usr/sbin/collectd 
    2815} 
Note: See TracChangeset for help on using the changeset viewer.