以下在Debian8和CentOS7测试成功。仅路径有所不同。
安装参考shadowsocks-libev在github的说明。Debian用jessie-backports安装,CentOS用Fedora-Copr安装。
以下说明为Debian8上的操作。
cp /lib/systemd/system/shadowsocks-libev.service /lib/systemd/system/shadowsocks-libev1.service
nano /lib/systemd/system/shadowsocks-libev1.service
# This file is part of shadowsocks-libev.
#
# Shadowsocks-libev is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This file is default for Debian packaging. See also
# /etc/default/shadowsocks-libev for environment variables.
[Unit]
Description=Shadowsocks-libev 1 Server Service
Documentation=man:shadowsocks-libev(8)
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/default/shadowsocks-libev1
User=nobody
Group=nogroup
LimitNOFILE=32768
ExecStart=/usr/bin/ss-server -c $CONFFILE $DAEMON_ARGS
[Install]
WantedBy=multi-user.target
cp /etc/default/shadowsocks-libev /etc/default/shadowsocks-libev1
nano /etc/default/shadowsocks-libev1
# Defaults for shadowsocks initscript
# sourced by /etc/init.d/shadowsocks-libev
# installed at /etc/default/shadowsocks-libev by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Note: `START', `GROUP' and `MAXFD' options are not recognized by systemd.
# Please change those settings in the corresponding systemd unit file.
# Enable during startup?
START=yes
# Configuration file
CONFFILE="/etc/shadowsocks-libev/config1.json"
# Extra command line arguments
DAEMON_ARGS="-u -v"
# User and group to run the server as
USER=nobody
GROUP=nogroup
# Number of maximum file descriptors
MAXFD=32768
cp /etc/shadowsocks-libev/config.json /etc/shadowsocks-libev/config1.json
nano /etc/default/shadowsocks-libev1
修改config1.json文件。
systemctl enable shadowsocks-libev1
systemctl start shadowsocks-libev1
systemctl status shadowsocks-libev1
安装参考shadowsocks-libev在github的说明。Debian用jessie-backports安装,CentOS用Fedora-Copr安装。
以下说明为Debian8上的操作。
cp /lib/systemd/system/shadowsocks-libev.service /lib/systemd/system/shadowsocks-libev1.service
nano /lib/systemd/system/shadowsocks-libev1.service
# This file is part of shadowsocks-libev.
#
# Shadowsocks-libev is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This file is default for Debian packaging. See also
# /etc/default/shadowsocks-libev for environment variables.
[Unit]
Description=Shadowsocks-libev 1 Server Service
Documentation=man:shadowsocks-libev(8)
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/default/shadowsocks-libev1
User=nobody
Group=nogroup
LimitNOFILE=32768
ExecStart=/usr/bin/ss-server -c $CONFFILE $DAEMON_ARGS
[Install]
WantedBy=multi-user.target
cp /etc/default/shadowsocks-libev /etc/default/shadowsocks-libev1
nano /etc/default/shadowsocks-libev1
# Defaults for shadowsocks initscript
# sourced by /etc/init.d/shadowsocks-libev
# installed at /etc/default/shadowsocks-libev by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Note: `START', `GROUP' and `MAXFD' options are not recognized by systemd.
# Please change those settings in the corresponding systemd unit file.
# Enable during startup?
START=yes
# Configuration file
CONFFILE="/etc/shadowsocks-libev/config1.json"
# Extra command line arguments
DAEMON_ARGS="-u -v"
# User and group to run the server as
USER=nobody
GROUP=nogroup
# Number of maximum file descriptors
MAXFD=32768
cp /etc/shadowsocks-libev/config.json /etc/shadowsocks-libev/config1.json
nano /etc/default/shadowsocks-libev1
修改config1.json文件。
systemctl enable shadowsocks-libev1
systemctl start shadowsocks-libev1
systemctl status shadowsocks-libev1
没有评论:
发表评论