Changeset 28967


Ignore:
Timestamp:
2011-11-12T02:30:25+01:00 (6 years ago)
Author:
nico
Message:

packages/scanlogd: change chroot to /var/run/scanlogd, use new service functions, create scanlogd user and group at start

Location:
packages/net/scanlogd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/scanlogd/Makefile

    r26055 r28967  
    11# 
    2 # Copyright (C) 2006-2009 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:=scanlogd 
    1111PKG_VERSION:=2.2.6 
    12 PKG_RELEASE:=1 
     12PKG_RELEASE:=2 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     
    3939 
    4040define Build/Configure   
    41         $(SED) "s,/var/empty,/tmp/.scanlogd," $(PKG_BUILD_DIR)/params.h 
    42         $(SED) "s,#undef SCANLOGD_DEVICE,#define SCANLOGD_DEVICE \"all\"," $(PKG_BUILD_DIR)/params.h 
     41        $(SED) 's,^#define \(SCANLOGD_CHROOT\).*,#define \1 "/var/run/scanlogd",' \ 
     42            -e 's,^#undef \(SCANLOGD_DEVICE\),#define \1 "all",' \ 
     43            $(PKG_BUILD_DIR)/params.h 
    4344endef 
    4445 
  • packages/net/scanlogd/files/scanlogd.init

    r10734 r28967  
    11#!/bin/sh /etc/rc.common 
    22# Copyright (C) 2006 OpenWrt.org 
     3 
    34START=50 
    45 
    56start() { 
    6         mkdir -p `grep "^scanlogd:" /etc/passwd | cut -d: -f6` 
    7         /usr/sbin/scanlogd 
     7        user_exists scanlogd 51 || user_add scanlogd 51 
     8        group_exists scanlogd 51 || group_add scanlogd 
     9        [ -d  /var/run/scanlogd ] || { 
     10                mkdir -m 0755 -p /var/run/scanlogd 
     11                chmod 0755 /var/run/scanlogd 
     12                chown scanlogd:scanlogd /var/run/scanlogd 
     13        } 
     14        service_start /usr/sbin/scanlogd 
    815} 
    916 
    1017stop() { 
    11         killall scanlogd 
     18        service_stop /usr/sbin/scanlogd 
    1219} 
Note: See TracChangeset for help on using the changeset viewer.