Can't remove sysntpd - image builder

Using image builder, I see that my build has an ntpd server.
To shut that service down, I use '/etc/init.d/sysntpd disable' and '/etc/init.d/sysntpd stop' but it seems to get enabled again when I reboot.
I don't need an ntp server, just a client but there is no package called ntp, ntpd or sysntpd so how can I remove this package to use ntpdate instead?

By compiling a personal firmware from sources, with either

Or just leave it there and disable the server side in UCI config file /etc/config/system

Specifically with imagebuilder, the options are more restricted as it is no real compiling, but just gluing components together.
But overriding the init script with a custom file should still be possible.

I think I'm wrong. It seems that using disable did disable the service.
Now I can run /usr/sbin/ntpd as a client, as needed.

However, I still don't know how to remove it since I don't have it as a package.
I looked at the link you shared but I'm not sure how to use that with image builder.
Searching for 'config BUSYBOX_DEFAULT_NTPD' results in nothing found.

But overriding the init script with a custom file should still be possible.

Yes, that's what I was thinking too.
In the second link you share, it looks like the sysntpd service controls the ntpd service but I don't see what I have to change to prevent the service from starting.

Thing is, that sysntpd service seems to also be related with dhcp and maybe some other things I don't want to break.

Yeah, that is for real compilation with toolchain.
Imagebuilder is just for gluing a simple firmware together, but you can't change package compile options. You should start using the full toolchain if you want deeper modifications to core components.

If you want to modify package init scripts, you will need to start familiarizing yourself with OpenWrt internals...

Easiest might be to just remove most stuff from start_service, or have start_ntpd_instance to return early, before actually starting anything.

Yep, trying to modify core functionality can be tricky, so you should be well prepared for unbricking, just in case.

I'm looking at the sysntpd file and I think I would just have to edit what ever starts the ntpd service in this (the start ntpd line) then add this file into my build. I'm just not 100% sure which part to edit.

start_ntpd_instance() {
        [ -x /sbin/ujail -a -e /etc/capabilities/ntpd.json ] && {
                procd_add_jail ntpd ubus
                procd_set_param capabilities /etc/capabilities/ntpd.json
        validate_ntp_section ntp start_ntpd_instance

I commented this out on my running OS to test.

vi /etc/init.d.sysntpd

      [ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT"
       for peer in $server; do
               procd_append_param command -p $peer

This seems to work. Even if I start the sysntpd service, I see no ntpd processes running now.
But, it's not clear to me if sysntpd is an essential service for something else.

The client is, so that the router itself has a correct time, but nothing in the router itself should need the server (which targets downstream LAN clients).

I would prefer to keep using image builder. I've used the source before and it's overkill for my needs.

To keep the time synced up, I just connect to every 12hrs or so from a script which is why I don't need a running ntp process.

Commenting those lines out seems to be working. Even if I start the sysntpd service, no ntpd processes are showing up. Assuming that doesn't bork anything and sysntpd is not an essential service, which I think you mention it's not, this could work.

It would be easier still to just have a file in init.d that simply prevented the sysntpd service from starting.

Can anyone confirm if this is the change I need to make? I would place the edited file in the /etc/init.d/ directory.

Does anyone know what the sysntpd service does specifically? Should it disabled if I'm not using ntpd? Can it be? Are there any ramifications?

1 Like

This change seems to be working but I have no way to know if it might be causing other problems.

I see this in logread;

Tue Aug 29 17:00:00 2023 cron.err crond[1938]: USER root pid 15980 cmd /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p -p -q

Running this manually shows no cron.err, but logread does.
Does it mean that cron is not able to run this?

No. Not an error. It’s a notice from cron that at Tue Aug 29 17:00:00 2023 cron ran the command β€˜ /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p -p -q’

Thanks. I just found a post on that so was about to remove that question.