Adguardhome ipk autostart not working after reboot

Hello,

Is it naming case is correct for adguardhome ipk package? Once reboot its not autostart service. And i notice the file names are AdGuardHome and adgaurdhome as well.

service adguardhome enable
service adguardhome start

find / -iname adg*

/etc/config/adguardhome
/etc/init.d/adguardhome
/etc/adguardhome.yaml
/lib/upgrade/keep.d/adguardhome
/overlay/upper/usr/lib/opkg/info/adguardhome.postinst
/overlay/upper/usr/lib/opkg/info/adguardhome.conffiles
/overlay/upper/usr/lib/opkg/info/adguardhome.control
/overlay/upper/usr/lib/opkg/info/adguardhome.list
/overlay/upper/usr/lib/opkg/info/adguardhome.prerm
/overlay/upper/usr/bin/AdGuardHome
/overlay/upper/lib/upgrade/keep.d/adguardhome
/overlay/upper/etc/adguardhome.yaml
/overlay/upper/etc/config/adguardhome
/overlay/upper/etc/init.d/adguardhome
/sys/fs/cgroup/services/adguardhome
/tmp/adguardhome
/usr/bin/AdGuardHome
/usr/lib/opkg/info/adguardhome.postinst
/usr/lib/opkg/info/adguardhome.conffiles
/usr/lib/opkg/info/adguardhome.control
/usr/lib/opkg/info/adguardhome.list
/usr/lib/opkg/info/adguardhome.prerm

1 Like

Gets run when you enable a service (did you?), does it contain the capital letters?

Every example I've seen uses AdGuardHome.

To Linux, adguardhome and AdGuardHome are two different things.

Its a package 'opkg install adguardhome' which i install from opkg library, and once installed I just run two line commands
service adguardhome enable
service adguardhome start

and rest all web based instructions from http://x.x.x.x:3000/ i set. The issue is it turn off on reboot and manually need to run "service adguardhome start" to start service. So here "adguardhome" is all smallcaps where as ./bin/ Titles Caps file name AdGuardHome. Just wondering it could be a issue of non-auto-start of service!?

Ty.

Of course it could.

As mentioned above...

It could be a simple race condition, you could add the service start to your local start up script.
Might make sense to add a sleep before the adguard start.

Which one is this from above two links?

a) adguard.com
b) github.com/AdguardTeam

Ty.

That's a package name, not the naming convention for AdGuardHome components.

If you execute service adguardhome start, and it's actually expecting service AdGuardHome start , yours won't work.

You need to look at the documentation, and find out if it's correct.

But in /etc/rc.d/ both Start and Stop files there. Should i check the script code of these two files?

What's the actual problem?

It doesn't start on boot, but works if started manually?
If that's the case, it has nothing to do with the files and their naming.

Yes its start with manual but after reboot its not autostart.

Here the both rc.d files for start / stop scripts

cat /etc/rc.d/K89adguardhome
#!/bin/sh /etc/rc.common

PROG=/usr/bin/AdGuardHome

USE_PROCD=1

# starts after network starts
START=21
# stops before networking stops
STOP=89

start_service() {
  config_load adguardhome
  config_get WORK_DIR config workdir

  [ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR"

  procd_open_instance
  procd_set_param command "$PROG" -c /etc/adguardhome.yaml -w "$WORK_DIR" --no-check-update
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}


cat /etc/rc.d/S21adguardhome
#!/bin/sh /etc/rc.common

PROG=/usr/bin/AdGuardHome

USE_PROCD=1

# starts after network starts
START=21
# stops before networking stops
STOP=89

start_service() {
  config_load adguardhome
  config_get WORK_DIR config workdir

  [ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR"

  procd_open_instance
  procd_set_param command "$PROG" -c /etc/adguardhome.yaml -w "$WORK_DIR" --no-check-update
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}

You need to look at the documentation...

Ok, i am checking now.

Then the problem isn't with the adguard scripts.
Use the workaround provided.

You could also try to rename the start softlink to S99, instead of S21, so it starts last.

Added manually as suggestion but not working.

And after manual start its working without any issue. Seems like binding issue but i didnt notice any other log or err.

Now only option i have to either reinstall once again or live with this manual start. :frowning:

Read the post with the suggestion again.

Finally seems its fixed. That 21 to 99 is working solution as of now. Thank you :slight_smile:

So here first I run

a) service adguardhome disable
b) vi /etc/init.d/adguardhome. Change Start from 21 to 99 and Stop 89 to 120.
c) service adguardhome enable
d) reboot

1 Like

Or in /etc/rc.d do mv S21adguardhome S99adguardhome

2 Likes