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)
committerFelix Fietkau <nbd@nbd.name>
Sun, 5 Mar 2017 15:38:41 +0000 (16:38 +0100)
commit8f218f5626a3cb3900dbe9801ee8ace236b0e4a5
tree86b41c2c6d4e48d1a9fb2e245e06394c538ec5f0
parent35209a01f2df708546d5aecca05cdcf11c0e7332
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