procd: service gets deleted when its last instance is freed
authorAlin Năstac <alin.nastac@gmail.com>
Mon, 27 Feb 2017 09:08:34 +0000 (10:08 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 20 Jun 2017 14:48:43 +0000 (16:48 +0200)
commit271622810ee2b2c6bf6127660f395c53f5f87b1c
treecf0578416c889832fc14302d1b53d3db50f5ce29
parent5f9124103410c178d816bb5229fba7dd2286a49b
procd: service gets deleted when its last instance is freed

This fixes the following regression introduced in commit
961dc692aff7457f874bce61f8e766514edcf794:
 1) reboot using the following configuration
root@OpenWrt:~# uci show system.ntp
system.ntp=timeserver
system.ntp.enable_server='0'
system.ntp.use_dhcp='1'
system.ntp.dhcp_interface='wan'
root@OpenWrt:~# uci show network.wan
network.wan=interface
network.wan.proto='dhcp'
network.wan.ifname='eth4'
network.wan.reqopts='1 3 6 15 33 42 51 121 249'
 2) if obtained DHCP lease has an option 42 sysntpd service will have an
 instance
 3) run "ifup wan"
 4) although the same DHCP lease was obtained, sysntpd would be stopped

Because sysntpd service is deleted when last instance is freed, its triggers
will also be released. Without these triggers in place, sysntpd will not be
reloaded when a new DHCP lease containing option 42 will be received.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
service/service.c
service/service.h