source: packages/admin/zabbix/files/zabbix_agentd.init @ 28892

Last change on this file since 28892 was 28892, checked in by nico, 5 years ago

packages/zabbix: use new service functions, various other zabbix-agent fixes:

  • move user/group creation from postinst to initscript
  • use /var/run/zabbix directory for pid file
  • use /var/log/zabbix directory for log file
  • set correct ownership and perms for both directories
File size: 578 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2008-2011 OpenWrt.org
3
4START=60
5
6SERVICE_PID_FILE=/var/run/zabbix/zabbix_agentd.pid
7
8start() {
9        [ -f /etc/zabbix/zabbix_agentd.conf ] || return 1
10        user_exists zabbix 53 || user_add zabbix 53
11        group_exists zabbix 53 || group_add zabbix 53
12        [ -d /var/log/zabbix ] || {
13                mkdir -m0755 -p /var/log/zabbix
14                chown zabbix:zabbix /var/log/zabbix
15        }
16        [ -d /var/run/zabbix ] || {
17                mkdir -m0755 -p /var/run/zabbix
18                chown zabbix:zabbix /var/run/zabbix
19        }
20        service_start /usr/sbin/zabbix_agentd
21}
22
23stop() {
24        service_stop /usr/sbin/zabbix_agentd
25}
Note: See TracBrowser for help on using the repository browser.