Ignore:
Timestamp:
2011-11-09T20:48:55+01:00 (4 years ago)
Author:
nico
Message:

packages/monit: use new service functions, fix /etc/monitrc permissions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/admin/monit/files/monit.init

    r15247 r28887  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2006 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33 
    44START=60 
    5 BIN=monit 
    6 DEFAULT=/etc/default/$BIN 
    7 RUN_D=/var/run 
    8 PID_F=$RUN_D/$BIN.pid 
     5 
     6SERVICE_USE_PID=1 
    97 
    108start() { 
    11         [ -f $DEFAULT ] && . $DEFAULT 
    12         mkdir -p $RUN_D 
    13         $BIN $OPTIONS 
     9        [ -f /etc/monitrc ] || return 1 
     10        [ "$(stat -c "%a" /etc/monitrc)" = "0700" ] || chmod 0700 /etc/monitrc 
     11        service_start /usr/bin/monit -d 60 
    1412} 
    1513 
    1614stop() { 
    17         [ -f $PID_F ] && kill $(cat $PID_F) 
     15        service_stop /usr/bin/monit 
    1816} 
    19  
Note: See TracChangeset for help on using the changeset viewer.