1 Purpose: Add support for a X-Interactive keyword to avoid specifying it in insserv.conf
3 Status: Work in progress.
6 Index: insserv/insserv.8.in
7 ===================================================================
8 --- insserv.orig/insserv.8.in 2009-09-26 22:35:25.000000000 +0200
9 +++ insserv/insserv.8.in 2009-09-26 22:35:43.000000000 +0200
11 # X-Stop-After: boot_facility_1 [ boot_facility_2 ...]
12 # Default-Start: run_level_1 [ run_level_2 ...]
13 # Default-Stop: run_level_1 [ run_level_2 ...]
14 + # X-Interactive: true
15 # Short-Description: single_line_description
16 # Description: multiline_description
19 these tags is stopped.
22 +The optional X\-Interactive keyword implies that the script using this
23 +keyword should be started alone in a concurrent boot configuration
24 +because it interact with the user at the console. Only the value
25 +`true' is recogniced. All other are ignored.
29 keyword implies that the script using this keyword
30 Index: insserv/insserv.c
31 ===================================================================
32 --- insserv.orig/insserv.c 2009-09-26 22:35:39.000000000 +0200
33 +++ insserv/insserv.c 2009-09-26 22:35:43.000000000 +0200
35 #define DEFAULT_START DEFAULT START VALUE
36 #define DEFAULT_STOP DEFAULT STOP VALUE
37 #define DESCRIPTION COMM "description" VALUE
38 +#define INTERACTIVE COMM "x-interactive" VALUE
40 /* System facility search within /etc/insserv.conf */
41 #define EQSIGN "([[:blank:]]*[=:][[:blank:]]*|[[:blank:]]+)"
47 } attribute((aligned(sizeof(char*)))) lsb_t;
49 /* Search results points here */
55 } attribute((aligned(sizeof(regex_t)))) reg_t;
57 typedef struct creg_struct {
59 regcompiler(®.def_start, DEFAULT_START, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
60 regcompiler(®.def_stop, DEFAULT_STOP, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
61 regcompiler(®.desc, DESCRIPTION, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
62 + regcompiler(®.interact, INTERACTIVE, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
65 static inline void scan_script_reset(void) attribute((always_inline));
67 xreset(script_inf.default_start);
68 xreset(script_inf.default_stop);
69 xreset(script_inf.description);
70 + xreset(script_inf.interactive);
73 #define FOUND_LSB_HEADER 0x01
75 #define default_start script_inf.default_start
76 #define default_stop script_inf.default_stop
77 #define description script_inf.description
78 +#define interactive script_inf.interactive
80 info("Loading %s\n", path);
82 @@ -1273,6 +1279,14 @@
86 + if (!interactive && regexecutor(®.interact, COMMON_ARGS) == true) {
87 + if (val->rm_so < val->rm_eo) {
88 + *(pbuf+val->rm_eo) = '\0';
89 + interactive = xstrdup(pbuf+val->rm_so);
91 + interactive = empty;
94 /* Skip scanning below from LSB magic end */
95 if ((end = strstr(buf, "### END INIT INFO")))
105 @@ -1503,6 +1518,7 @@
106 regfree(®.def_start);
107 regfree(®.def_stop);
109 + regfree(®.interact);
113 @@ -1781,6 +1797,9 @@
114 if (script_inf.stop_after && script_inf.stop_after != empty) {
115 reversereq(service, REQ_SHLD|REQ_KILL, script_inf.stop_after);
117 + if (script_inf.interactive && 0 == strcmp(script_inf.interactive, "true")) {
118 + service->attr.flags |= SERV_INTRACT;
123 @@ -2881,6 +2900,9 @@
124 if (script_inf.should_stop && script_inf.should_stop != empty) {
125 rememberreq(service, REQ_SHLD|REQ_KILL, script_inf.should_stop);
127 + if (script_inf.interactive && 0 == strcmp(script_inf.interactive, "true")) {
128 + service->attr.flags |= SERV_INTRACT;
132 if (script_inf.start_before && script_inf.start_before != empty) {