From 0ce9c15186e2fcadc02b80e7e41af41eb98ac643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E6=B5=A6=E6=9C=88?= Date: Sun, 9 Mar 2014 12:36:59 +0800 Subject: [PATCH] Update shadowsocks.init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.使用OpenWrt提供的service_start及service_stop函数控制服务开关 2.由service_start函数生成pid文件 3.改配置文件目录为/etc/shadowsocks.json --- openwrt/files/shadowsocks.init | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openwrt/files/shadowsocks.init b/openwrt/files/shadowsocks.init index 9aabd8f7..7d179638 100644 --- a/openwrt/files/shadowsocks.init +++ b/openwrt/files/shadowsocks.init @@ -2,15 +2,15 @@ # Copyright (C) 2006-2011 OpenWrt.org START=95 -STOP=95 + +SERVICE_USE_PID=1 +SERVICE_WRITE_PID=1 +SERVICE_DAEMONIZE=1 start() { - echo "starting shadowsocks..." - /usr/bin/ss-local -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid + service_start /usr/bin/ss-local -c /etc/shadowsocks.json } stop() { - echo "shadowsocks stopped." - kill -9 `cat /var/run/shadowsocks.pid` + service_stop /usr/bin/ss-local } -