Control-D-Inc / ctrld

A highly configurable, multi-protocol DNS forwarding proxy
MIT License
438 stars 21 forks source link

DD-WRT Install Fails #47

Closed czoop closed 1 year ago

czoop commented 1 year ago

Trying to setup 1.2 on my DD-WRT router: Firmware: DD-WRT v3.0-r44048 std (08/02/20)

root@router:/jffs/controld# ./ctrld setup ddwrt
May 28 01:15:50.000 ERR Service did not start, please check system/service log for details error
May 28 01:15:50.000 FTL exit status 1

Seems that your scripts are trying to use the following command to start the service:

/jffs/controld/ctrld run --cd <REMOVED> --router --iface=auto --homedir=/jffs/controld --config=/jffs/controld/ctrld.toml

When I run this directly I get:

root@router:/jffs/controld# ./ctrld run --cd <...> --router --iface=auto --homedir=/jffs/controld --config=/jffs/controld/ctrld.toml
May 28 01:11:36.000 FTL failed to perform router pre-start check error="PreStart: merlinRestartDNSMasq: restart_dnsmasq: service servicename start|stop|restart|main args... [-f]
options:
-f : force start of service, no matter if neccessary
list of services:
    addpppoeconnected   [main]
    addpppoetime        [main]
    beep            [main]
    ddns_success        [main]
    delpppoeconnected   [main]
    dhcp6c_state        [main]
    disconnected_pppoe  [main]
    filter          [main]
    filtersync      [main]
    getbridge       [main]
    getipmask       [main]
    getmask         [main]
    get_nfmark      [main]
    get_wanface     [main]
    get_wanip       [main]
    gpio            [main]
    hb_connect      [main]
    hb_disconnect       [main]
    ipdown          [main]
    ipfmt           [main]
    ipup            [main]
    ledtracking     [main]
    pptpd           [main]
    restart_dns     [main]
    setpasswd       [main]
    setportprio     [main]
    setuserpasswd       [main]
    site_survey     [main]
    bonding         [start] [stop] [restart] 
    bridgesif       [start] [stop] [restart] 
    bridging        [start] [stop] [restart] 
    checkhostapd        [start] 
    check_qmi       [start] 
    check_sierradirectip    [start] 
    check_sierrappp     [start] 
    chilli          [start] [stop] [restart] 
    configurewifi       [start] 
    config_vlan     [start] 
    conntrack       [start] [stop] [restart] 
    cron            [start] [stop] [restart] 
    ddns            [start] [stop] [restart] 
    deconfigurewifi     [start] 
    defaults        [start] 
    devinit         [start] 
    dhcp6c          [start] [stop] [restart] 
    dhcp6s          [start] [stop] [restart] 
    dhcpfwd         [start] [stop] [restart] 
    dlna            [start] [stop] [restart] 
    dlna_rescan     [start] 
    dns_clear_resolv    [start] [stop] [restart] 
    dnsmasq         [start] [stop] [restart] 
    drivers         [start] [stop] [restart] 
    drivers_net     [start] 
    duallink        [start] 
    firewall        [start] [stop] [restart] 
    firewall6       [start] [stop] [restart] 
    force_to_dial       [start] [stop] [restart] 
    freeradius      [start] [stop] [restart] 
    ftpsrv          [start] [stop] [restart] 
    gen_radius_cert     [start] [stop] [restart] 
    heartbeat_boot      [start] [stop] [restart] 
    heartbeat_redial    [start] [stop] [restart] 
    hostapdwan      [start] 
    hotplug_block       [start] [stop] [restart] 
    hotplug_net     [start] [stop] [restart] 
    hotplug_usb     [start] 
    httpd           [start] [stop] [restart] 
    hwmon           [start] [stop] [restart] 
    igmprt          [start] [stop] [restart] 
    init_restart        [start] 
    init_start      [start] 
    init_stop       [start] 
    init_user       [start] 
    iptqueue        [start] [stop] [restart] 
    ipv6            [start] [stop] [restart] 
    ipvs            [start] [stop] [restart] 
    jffs2           [start] [stop] [restart] 
    l2tp_boot       [start] 
    l2tp_redial     [start] 
    lan         [start] [stop] [restart] 
    lighttpd        [start] [stop] [restart] 
    loadfwmodules       [start] 
    mactelnetd      [start] [stop] [restart] 
    mkfiles         [start] 
    modules         [start] [stop] [restart] 
    modules_wait        [start] 
    nfs         [start] [stop] [restart] 
    nstxd           [start] [stop] [restart] 
    nvram           [start] 
    olsrd           [start] [stop] [restart] 
    openvpn         [start] [stop] [restart] 
    openvpnserver       [start] [stop] [restart] 
    openvpnserversys    [start] [stop] [restart] 
    openvpnserverwan    [start] [stop] [restart] 
    overclocking        [start] 
    post_sysinit        [start] 
    pppmodules      [start] [stop] [restart] 
    pppoerelay      [start] [stop] [restart] 
    pppoeserver     [start] [stop] [restart] 
    printer         [start] [stop] [restart] 
    privoxy         [start] [stop] [restart] 
    process_monitor     [start] [stop] [restart] 
    quagga_writememory  [start] 
    radio_off       [start] [stop] [restart] 
    radio_off_0     [start] [stop] [restart] 
    radio_off_1     [start] [stop] [restart] 
    radio_off_2     [start] [stop] [restart] 
    radio_on        [start] [stop] [restart] 
    radio_on_0      [start] [stop] [restart] 
    radio_on_1      [start] [stop] [restart] 
    radio_on_2      [start] [stop] [restart] 
    radio_timer     [start] [stop] [restart] 
    radvd           [start] [stop] [restart] 
    raid            [start] [stop] [restart] 
    redial          [start] [stop] [restart] 
    resetbutton     [start] [stop] [restart] 
    restarthostapd      [start] 
    restore_defaults    [start] 
    run_rc_shutdown     [start] [stop] [restart] 
    run_rc_startup      [start] [stop] [restart] 
    run_rc_usb      [start] [stop] [restart] 
    samba3          [start] [stop] [restart] 
    ses_led_control     [start] 
    set_routes      [start] 
    setup_vlans     [start] 
    sfe         [start] [stop] [restart] 
    smartd          [start] [stop] [restart] 
    smartdns        [start] [stop] [restart] 
    snmp            [start] [stop] [restart] 
    softether       [start] [stop] [restart] 
    speedchecker        [start] [stop] [restart] 
    speedchecker_init   [start] 
    splashd         [start] [stop] [restart] 
    sputnik         [start] [stop] [restart] 
    sshd            [start] [stop] [restart] 
    stabridge       [start] [stop] [restart] 
    sysinit         [start] 
    syslog          [start] [stop] [restart] 
    telnetd         [start] [stop] [restart] 
    tor         [start] [stop] [restart] 
    transmission        [start] [stop] [restart] 
    ttraff          [start] [stop] [restart] 
    udpxy           [start] [stop] [restart] 
    unbound         [start] [stop] [restart] 
    upnp            [start] [stop] [restart] 
    vifs            [start] [stop] [restart] 
    vlantagging     [start] [stop] [restart] 
    vncrepeater     [start] [stop] [restart] 
    vpn_modules     [start] [stop] [restart] 
    wan_boot        [start] 
    wan_redial      [start] 
    wan_service     [start] 
    wanup           [start] 
    wifidog         [start] [stop] [restart] 
    wland           [start] [stop] [restart] 
    wlconf          [start] [stop] [restart] 
    wol         [start] [stop] [restart] 
    wshaper         [start] [stop] [restart] 
    zabbix          [start] [stop] [restart] 
    zebra           [start] [stop] [restart] 
    3g          [stop] 
    dhcpc           [stop] 
    heartbeat       [stop] 
    l2tp            [stop] 
    ntpc            [stop] 
    openvpn_wandone     [stop] 
    pppoe           [stop] 
    pppoe_dual      [stop] 
    pptp            [stop] 
    wan         [stop] 
    supplicant      [main]
    udhcpc          [main]
    udhcpc_tv       [main]
, exit status 255
<SAME_MESSAGE_AGAIN>

Nothing terribly interesting in my syslog:

May 28 01:08:45 router user.info : dnsmasq : daemon successfully stopped
May 27 18:08:45 router daemon.info dnsmasq[1588]: exiting on receipt of SIGTERM
May 27 18:08:46 router daemon.info dnsmasq[4493]: started, version 2.82 cache disabled
May 27 18:08:46 router daemon.info dnsmasq[4493]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua no-TFTP no-conntrack no-ipset no-auth DNSSEC loop-detect no-inotify no-dumpfile
May 27 18:08:46 router daemon.info dnsmasq-dhcp[4493]: DHCP, IP range 10.0.1.5 -- 10.0.1.54, lease time 1d
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain test
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain onion
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain localhost
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain local
May 28 01:08:46 router user.info : dnsmasq : daemon successfully started
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain invalid
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain bind
May 27 18:08:46 router daemon.info dnsmasq[4493]: reading /tmp/resolv.dnsmasq
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain test
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain onion
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain localhost
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain local
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain invalid
May 27 18:08:46 router daemon.info dnsmasq[4493]: using only locally-known addresses for domain bind
May 27 18:08:46 router daemon.warn dnsmasq[4493]: ignoring nameserver 10.0.1.1 - local interface
May 27 18:08:46 router daemon.info dnsmasq[4493]: using nameserver 1.1.1.1#53
May 27 18:08:46 router daemon.info dnsmasq[4493]: using nameserver 1.0.0.1#53
May 27 18:08:46 router daemon.info dnsmasq[4493]: using nameserver 9.9.9.9#53
May 27 18:08:46 router daemon.info dnsmasq[4493]: using nameserver 8.8.8.8#53
May 27 18:08:46 router daemon.info dnsmasq[4493]: read /etc/hosts - 3 addresses
May 27 18:08:46 router daemon.warn dnsmasq-dhcp[4493]: not giving name localhost to the DHCP lease of 10.0.1.11 because the name exists in /etc/hosts with address 127.0.0.1
cuonglm commented 1 year ago

This is a known issue, will be fixed in v1.2.1 release.

czoop commented 1 year ago

Good to know, looking forward to it.

cuonglm commented 1 year ago

Good to know, looking forward to it.

You could try dev version which already fixed the problem:

root@DD-WRT:/jffs/controld# sh -c 'sh -c "$(curl -sL https://api.controld.dev/dl)" -s p2 forced'

        __         .__       .___
  _____/  |________|  |    __| _/
_/ ___\   __\_  __ \  |   / __ |
\  \___|  |  |  | \/  |__/ /_/ |
 \___  >__|  |__|  |____/\____ |
     \/       installer       \/

---------------------
|    System Info    |
---------------------
OS Type      : linux
OS Vendor    : DD-WRT
Is Router    : yes
Arch         : armv7l
CPU          : ARMv7 Processor rev 0 (v7l)
Free RAM     : 49 MB / 120 MB
---------------------
|  Install Details  |
---------------------
Resolver ID  : p2
Binary URL   : https://assets.controld.dev/ctrld/linux/armv5/ctrld
Install Path : /jffs/controld
---------------------
 - Detected running process, this is an upgrade
 - Starting download
 - Stopping running process
 - Replacing old binary with the new one
 - Making binary executable
 - Launching /jffs/controld/ctrld
---------------------
Jun  2 12:26:42.000 INF loading config file from: /jffs/controld/ctrld.toml
Jun  2 12:26:42.000 INF fetching Controld D configuration from API: p2 mode=cd
Jun  2 12:26:43.000 INF generating ctrld config from Control-D configuration mode=cd
Jun  2 12:26:43.000 INF writing config file to: /jffs/controld/ctrld.toml mode=cd
Jun  2 12:26:45.000 NTC Service started
cuonglm commented 1 year ago

This is now fixed with v1.2.1 release.

czoop commented 1 year ago

Awesome, I'll give it a try. Thanks!