Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdGuardHome installed wrong Init script #2757

Closed
berna1995 opened this issue Feb 25, 2021 · 4 comments
Closed

AdGuardHome installed wrong Init script #2757

berna1995 opened this issue Feb 25, 2021 · 4 comments
Assignees
Milestone

Comments

@berna1995
Copy link

  • Version of AdGuard Home server:
    • 0.105.1
  • How did you install AdGuard Home:
    • Github release, manually
  • How did you setup DNS configuration:
    • Router
  • If it's a router or IoT, please write device model:
    • DGA4130
  • CPU architecture:
    • ARM
  • Operating system and version:
    • OpenWRT 15.05

Expected Behavior

After install, i would exepct AdGuard to run and enable the correct init script

Actual Behavior

Init script is installed in /etc/init.d but it's not the correct one for OpenWRT and so it doesn't "enable" it.

Additional Information

Problem might be related to how OpenWRT is detected.

func IsOpenWRT() bool {
if runtime.GOOS != "linux" {
return false
}
body, err := ioutil.ReadFile("/etc/os-release")
if err != nil {
return false
}
return strings.Contains(string(body), "OpenWrt")
}

There is no guarantee that /etc/os-release file will be present in the host system, you should rather look for /etc/openwrt_release.

@ainar-g ainar-g added this to the v0.105.2 milestone Feb 25, 2021
adguard pushed a commit that referenced this issue Mar 1, 2021
Merge in DNS/adguard-home from 2757-openwrt to master

Updates #2757.

Squashed commit of the following:

commit 8e94e6a
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 17:02:24 2021 +0300

    util: convert only once

commit f1c74f4
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 16:22:51 2021 +0300

    util: log changes, imp docs

commit 0a4558d
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 15:53:26 2021 +0300

    util: imp os detection
@EugeneOne1
Copy link
Member

We've tried to improve the OpenWRT detection as of snapshot 91403d0. Could you please check if our solution fixes the issue for you?

@berna1995
Copy link
Author

I unfortunately cannot, at the moment, im running AdGuard Home in my main router and i would love not to reinstall it from scratch.

@EugeneOne1
Copy link
Member

Well, thanks for opening an issue anyway. Our testers checked the solution on our test machines, including the OpenWRT one, before it was merged to master. The closest update which will include that commit is 0.105.2. We'll close the issue for now. Feel free to reopen it if the bug persists after updating.

@adworacz
Copy link

adworacz commented Aug 7, 2021

I just ran into this bug using a custom build from Divested, which is effectively running OpenWRT HEAD with a few patches.

Looking at the AdguardHome code, it's checking for "OpenWrt" in /etc/*release.

However /etc/openwrt_release DOES exist, and contains the following:

DISTRIB_ID='Divested-WRT'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r17276+9-b1bff5cb57'
DISTRIB_TARGET='mvebu/cortexa9'
DISTRIB_ARCH='arm_cortex-a9_vfpv3-d16'
DISTRIB_DESCRIPTION='Divested-WRT SNAPSHOT r17276+9-b1bff5cb57'
DISTRIB_TAINTS='no-all'

Edit: Actually /etc/os-release exists as well, and contains:

NAME="Divested-WRT"
VERSION="SNAPSHOT"
ID="divested-wrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="Divested-WRT SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://divested.dev/unofficial-openwrt-builds/mvebu-linksys"
BUG_URL="https://github.com/divestedcg/Divested-WRT/issues"
SUPPORT_URL="xmpp:divested-wrt@conference.konvers.me?join"
BUILD_ID="r17276+9-b1bff5cb57"
OPENWRT_BOARD="mvebu/cortexa9"
OPENWRT_ARCH="arm_cortex-a9_vfpv3-d16"
OPENWRT_TAINTS="no-all"
OPENWRT_DEVICE_MANUFACTURER="Divested Computing Group"
OPENWRT_DEVICE_MANUFACTURER_URL="https://divested.dev"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="Divested-WRT SNAPSHOT r17276+9-b1bff5cb57"

heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 2757-openwrt to master

Updates AdguardTeam#2757.

Squashed commit of the following:

commit 8e94e6a
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 17:02:24 2021 +0300

    util: convert only once

commit f1c74f4
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 16:22:51 2021 +0300

    util: log changes, imp docs

commit 0a4558d
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Mon Mar 1 15:53:26 2021 +0300

    util: imp os detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants