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

Sysvinit service does not start AdGuardHome on boot #4480

Closed
nandlab opened this issue Apr 11, 2022 · 10 comments
Closed

Sysvinit service does not start AdGuardHome on boot #4480

nandlab opened this issue Apr 11, 2022 · 10 comments
Assignees
Milestone

Comments

@nandlab
Copy link

nandlab commented Apr 11, 2022

Issue Details

  • Version of AdGuard Home server:
    • 0.107.5
  • How did you install AdGuard Home:
    • curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
  • How did you setup DNS configuration:
    • No change.
  • If it's a router or IoT, please write device model:
    • It is a ThinkPad.
  • CPU architecture:
    • AMD64
  • Operating system and version:
    • Devuan GNU/Linux 4 (chimaera) x86_64

Expected Behavior

AdGuard Home should start automatically on boot.

Actual Behavior

AGH installed normally and placed the service /etc/init.d/AdGuardHome and created symlinks in /etc/rc?.d/.

But it is not started on boot. sudo service --status-all prints [ - ] AdGuardHome, which means it is not running.

Although I can start it manually with sudo service AdGuardHome start.

@ainar-g ainar-g added the needs investigation Needs to be reproduced reliably. label Apr 12, 2022
@ainar-g
Copy link
Contributor

ainar-g commented Apr 12, 2022

@EugeneOne1, please investigate. Perhaps, something is up with our vendored copy of the SysV init script?

@jumpsmm7
Copy link
Contributor

jumpsmm7 commented Apr 14, 2022

@nandlab
Have you tried to enable it with commands like

sudo systemctl enable AdGuardHome.service
sudo systemctl daemon-reload

If it is setup properly as a service, this should enable it to start on reboots.

Also, here is a pretty good guide if you feel like attempting the install foot work yourself.
https://sleeplessbeastie.eu/2021/05/17/how-to-install-adguard-home/

@nandlab
Copy link
Author

nandlab commented Apr 15, 2022

@jumpsmm7
Thanks for the reply!

I do not have systemd, so sudo systemctl enable AdGuardHome.service returns sudo: systemctl: command not found.

@jumpsmm7
Copy link
Contributor

@jumpsmm7 Thanks for the reply!

I do not have systemd, so sudo systemctl enable AdGuardHome.service returns sudo: systemctl: command not found.

Okay

@EugeneOne1 EugeneOne1 added bug and removed needs investigation Needs to be reproduced reliably. labels May 24, 2022
adguard pushed a commit that referenced this issue May 24, 2022
Merge in DNS/adguard-home from 4480-sysv-boot to master

Updates #4480.

Squashed commit of the following:

commit c9645b1
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue May 24 14:25:09 2022 +0300

    home: imp sysv script

commit cc32336
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon May 23 21:13:06 2022 +0300

    home: fix sysv service script
@EugeneOne1
Copy link
Member

@nandlab, the issue should be fixed as per the last edge build. Could you please check if it now starts on boot?

Note, that you may install the edge build via the script using these commands. Consider also backing up your data directory and the configuration file.

@ainar-g ainar-g added this to the v0.107.7 milestone May 30, 2022
@ainar-g
Copy link
Contributor

ainar-g commented Jun 2, 2022

We'll close this issue for now. Please feel free to open new ones if you find anything.

@ainar-g ainar-g closed this as completed Jun 2, 2022
adguard pushed a commit that referenced this issue Jun 2, 2022
Merge in DNS/adguard-home from 4480-sysv-boot to master

Updates #4480.

Squashed commit of the following:

commit c9645b1
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue May 24 14:25:09 2022 +0300

    home: imp sysv script

commit cc32336
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon May 23 21:13:06 2022 +0300

    home: fix sysv service script
@nandlab
Copy link
Author

nandlab commented Jun 4, 2022

Hello,
sorry, I did not have time to test it before.

I installed the edge build and the init script itself seems to work. I can manually start AdGuardHome and check its status.

  • sudo invoke-rc.d AdGuardHome start
  • sudo invoke-rc.d AdGuardHome status prints Running

But it is still does not start at boot.

It looks like the init scripts are installed incorrectly in /etc/rc?.d/.
For example the following symlink is created: /etc/rc2.d/S50AdGuardHome -> /etc/init.d/AdGuardHome.
Other symlinks look like this: /etc/rc2.d/S01console-setup.sh -> ../init.d/console-setup.sh.

Maybe the following things can cause problems:

  1. S50AdGuardHome references the absolute path /etc/init.d/AdGuardHome instead of the relative ../init.d/AdGuardHome.
  2. Its sequence number 50 is very large and it comes after /etc/rc2.d/S07rc.local -> ../init.d/rc.local which is normally the last script to be executed in a runlevel.

I can fix it by running sudo update-rc.d AdGuardHome defaults, which renames the symlink to S02AdGuardHome. Then AdGuardHome starts on boot.

Maybe you can install the init script correctly by running something like sudo update-rc.d AdGuardHome defaults in the installation script.

@nandlab
Copy link
Author

nandlab commented Jun 4, 2022

Can you please reopen this issue?

@ainar-g ainar-g reopened this Jun 6, 2022
@ainar-g ainar-g modified the milestones: v0.107.7, v0.107.8 Jun 6, 2022
adguard pushed a commit that referenced this issue Jun 14, 2022
Merge in DNS/adguard-home from 4480-sysv-again to master

Updates #4480.

Squashed commit of the following:

commit 263fa05
Merge: 360a646 d3f39b0
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jun 14 13:36:15 2022 +0300

    Merge branch 'master' into 4480-sysv-again

commit 360a646
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:15:41 2022 +0300

    home: rename linux file

commit c303253
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:06:25 2022 +0300

    home: imp code

commit 2381c4a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 17:48:22 2022 +0300

    home: wrap sysv service
@EugeneOne1
Copy link
Member

@nandlab, hello again. Thanks for the report and sorry for the late response. It should be finally fixed in the latest edge build. Could you please check it for us again?

@nandlab
Copy link
Author

nandlab commented Jun 15, 2022

Now it works, thank you very much!

@nandlab nandlab closed this as completed Jun 15, 2022
adguard pushed a commit that referenced this issue Jul 13, 2022
Merge in DNS/adguard-home from 4480-sysv-again to master

Updates #4480.

Squashed commit of the following:

commit 263fa05
Merge: 360a646 d3f39b0
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jun 14 13:36:15 2022 +0300

    Merge branch 'master' into 4480-sysv-again

commit 360a646
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:15:41 2022 +0300

    home: rename linux file

commit c303253
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:06:25 2022 +0300

    home: imp code

commit 2381c4a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 17:48:22 2022 +0300

    home: wrap sysv service
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 4480-sysv-boot to master

Updates AdguardTeam#4480.

Squashed commit of the following:

commit c9645b1
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue May 24 14:25:09 2022 +0300

    home: imp sysv script

commit cc32336
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon May 23 21:13:06 2022 +0300

    home: fix sysv service script
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 4480-sysv-again to master

Updates AdguardTeam#4480.

Squashed commit of the following:

commit 263fa05
Merge: 360a646 d3f39b0
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jun 14 13:36:15 2022 +0300

    Merge branch 'master' into 4480-sysv-again

commit 360a646
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:15:41 2022 +0300

    home: rename linux file

commit c303253
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 18:06:25 2022 +0300

    home: imp code

commit 2381c4a
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Jun 9 17:48:22 2022 +0300

    home: wrap sysv service
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