Hev-socks5-server runs manually, but doesn't autostart

Hello all,

A quick overview: I am running OpenWRT on x86_64 v24.10.0-rc2 r28161-ea17e958b9, I used opkg to install hev-socks5-server from the official repo, all went well.

I edited the config file /etc/hev-socks5-server/main.yml to change the bind port off the default 1080, and have confirmed the socks5 server works if I run it manually with the $binary $conffile syntax given by the author on github.

/usr/bin/hev-socks5-server /etc/hev-socks5-server/main.yml

However, the init.d service seems to not be working... After a fresh reboot, I see the following:

root@Xi3-OpenWRT:~# /etc/init.d/hev-socks5-server status
active with no instances
root@Xi3-OpenWRT:~#

If I do /etc/init.d/hev-socks5-server reload and /etc/init.d/hev-socks5-server restart, it completes, but no change.

Looking at the port bindings, I also don't see it with netstat -a -n, unless again I run it manually, then it shows up normally.

Here is the init.d script that came w/ the official package.

#!/bin/sh /etc/rc.common

USE_PROCD=1
START=99

CONF="hev-socks5-server"
PROG="/usr/bin/hev-socks5-server"

start_service() {
        config_load "$CONF"

        local enabled
        config_get_bool enabled "config" "enabled" "0"
        [ "$enabled" -eq "1" ] || return 1

        local conffile
        config_get conffile "config" "conffile"

        procd_open_instance "$CONF"
        procd_set_param command "$PROG" "$conffile"
        procd_set_param file "$conffile"

        procd_set_param limits core="unlimited"
        procd_set_param limits nofile="1000000 1000000"
        procd_set_param stdout 1
        procd_set_param stderr 1
        procd_set_param respawn

        procd_close_instance
}

service_triggers() {
        procd_add_reload_trigger "$CONF"
}

I do not see anything wrong here -- my first guess is that the daemon is closing due to not finding the config file, but that's only a guess. This is above my linux paygrade a bit, any help is appreciated.

Cheers!

is it, enabled ?

1 Like

Oh wow, how'd I not see that.

If I run /etc/init.d/hev-socks5-server enable, it completes w/o errors, but the init.d script doesn't change and server doesn't start. Does it need to be enabled in Luci maybe? Let me look.

I'm guessing in the conf file, where ever it's located, /etc/config ?

Yes, you're right... the main.yml file is what I was working with, it doesn't have that option, but in /etc/config there is:

root@Xi3-OpenWRT:/etc/config# cat hev-socks5-server
config hev-socks5-server 'config'
        option enabled '0'
        option conffile '/etc/hev-socks5-server/main.yml'

Changed option enabled to '1' and it works fine after reloading and starting. Thank you. Feel a little silly because I'd looked at this file in search for the main.yml

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.