mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
Allow services to be added *and removed* from /etc/finit.conf
This patch fixes a long standing issue where removing a service from
/etc/finit.conf does not stop and unregister it. The issue was caused
by the Finit support for "protected" services, e.g. services created
by plugins like hotplug.so
To reproduce issue before this fix:
cat /etc/finit.d/available/ntpd.conf >> /etc/finit.conf
initctl reload
The NTP service now runs smoothly, as expected. Later on, we decide to
drop it from our system:
sed -i 1,2d /etc/finit.conf
initctl reload
... and the NTP service continues to run unaffected. Not what most sane
users expect.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -626,7 +626,7 @@ static int parse_conf(char *file)
|
||||
_d("%s", line);
|
||||
|
||||
parse_static(line);
|
||||
parse_dynamic(line, global_rlimit, NULL);
|
||||
parse_dynamic(line, global_rlimit, file);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
@@ -1107,6 +1107,7 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
else
|
||||
svc_mark_clean(svc);
|
||||
|
||||
/* for finit native services only, e.g. plugins/hotplug.c */
|
||||
if (!file)
|
||||
svc->protect = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user