Huh, this is interesting. I'm using yocto, and I recently was still on the morty branch and have updated to dunfell. Yocto is handling creating the prerm script for stopping ntp on removal. However, I see an issue. Here is the prerm script as it existed from my ntp package built with the morty branch:
#!/bin/sh
# Begin section update-rc.d
if [ -z "$D" -a -x "/etc/init.d/ntpd" ]; then
/etc/init.d/ntpd stop || :
fi
# End section update-rc.d
# Begin section update-alternatives
update-alternatives --remove ntpd /usr/sbin/ntpd.ntp
# End section update-alternatives
and here is the prerm script generated by the dunfell branch:
#!/bin/sh
set -e
update-alternatives --remove ntpd /usr/sbin/ntpd.ntp
if true && [ -z "$D" -a -x "/etc/init.d/ntpd" ]; then
/etc/init.d/ntpd stop || :
fi
I don't know why the prerm script is now removing the link to ntpd before attempting to stop ntpd. That explains why it didn't stop. I'm going to be going to the yocto forums now and try to figure what happened to the prerm script generation.
Thanks,
Bryan