Changeset 28838


Ignore:
Timestamp:
2011-11-07T23:58:50+01:00 (6 years ago)
Author:
nico
Message:

package/dropbear: use new service wrapper

Location:
trunk/package/dropbear
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/dropbear/Makefile

    r28718 r28838  
    1010PKG_NAME:=dropbear 
    1111PKG_VERSION:=0.53.1 
    12 PKG_RELEASE:=5 
     12PKG_RELEASE:=6 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
  • trunk/package/dropbear/files/dropbear.init

    r27843 r28838  
    33# Copyright (C) 2006 Carlos Sobrinho 
    44 
     5START=50 
     6STOP=50 
     7 
     8SERVICE_USE_PID=1 
     9 
    510NAME=dropbear 
    611PROG=/usr/sbin/dropbear 
    7 START=50 
    8 STOP=50 
    912PIDCOUNT=0 
    1013EXTRA_COMMANDS="killclients" 
     
    4952 
    5053        # prepare parameters (initialise with pid file) 
    51         local args="-P /var/run/${NAME}.${PIDCOUNT}.pid" 
     54        local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid" 
     55        local args="-P $pid_file" 
    5256        local val 
    5357        # A) password authentication 
     
    8185        # execute program and return its exit code 
    8286        [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} starting ${PROG} ${args}" 
    83         ${PROG} ${args} 
    84         return $? 
     87        SERVICE_PID_FILE="$pid_file" service_start ${PROG} ${args} 
    8588} 
    8689 
     
    121124stop() 
    122125{ 
    123         # killing all server processes 
    124         local pidfile 
    125         for pidfile in `ls /var/run/${NAME}.*.pid` 
    126          do 
    127                 start-stop-daemon -q -K -s KILL -p "${pidfile}" -n "${NAME}" 
    128                 rm -f "${pidfile}" 
     126        local pid_file pid_files 
     127         
     128        pid_files=`ls /var/run/${NAME}.*.pid 2>/dev/null` 
     129         
     130        [ -z "$pid_files" ] && return 1 
     131         
     132        for pid_file in $pid_files; do 
     133                SERVICE_PID_FILE="$pid_file" service_stop ${PROG} && { 
     134                        rm -f ${pid_file} 
     135                } 
    129136        done 
    130         [ -z "${pidfile}" ] && echo "${initscript}: no pid files, if you get problems with start then try killclients" 
    131137} 
    132138 
Note: See TracChangeset for help on using the changeset viewer.