diff --git a/cgattach.cpp b/cgattach.cpp index 6fce46e..7919c92 100644 --- a/cgattach.cpp +++ b/cgattach.cpp @@ -10,7 +10,7 @@ #include using namespace std; -void print_usage() { fprintf(stderr, "usage: cgattach \n"); } +void print_usage() { fprintf(stdout, "usage: cgattach \n"); } bool exist(string path) { struct stat st; @@ -25,8 +25,8 @@ bool validate(string pid, string cgroup) { bool cg_v = regex_match(cgroup, regex("^\\/[a-zA-Z0-9\\-_./@]*$")); if (pid_v && cg_v) return true; - // cout< - ## Prerequest - cgroup2 + Why cgroup v2? Because simple, elegant and intuitive. + For now, linux default using cgroup v1 for compatibility, this project need cgroup v2, you need disable cgroup v1 and enable cgroup v2 in your system. see [Disabling v1 cgroups](https://wiki.archlinux.org/index.php/Cgroups#Disabling_v1_cgroups). - TPROXY A process listening on port (e.g. 12345) to accept iptables TPROXY, for example v2ray's dokodemo-door in tproxy mode. + + Why not REDIRECT? Because REDIRECT only supports tcp and ipv4. ## How to install @@ -105,7 +108,7 @@ sudo systemctl restart cgproxy.service ## Global transparent proxy -- First, set **cgroup_proxy=/** in `/etc/cgproxy.conf`, this will proxy all connection +- First, set **cgroup_proxy="/"** in `/etc/cgproxy.conf`, this will proxy all connection - Then, run your proxy software in cgroup_noproxy to allow direct to internet