Lines 42-47
const char librc_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
Link Here
|
42 |
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) |
42 |
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) |
43 |
#endif |
43 |
#endif |
44 |
|
44 |
|
|
|
45 |
/* remove this line when rc_sys_v1 is to be removed as announced */ |
46 |
#define ENABLE_COMPAT_RC_SYS_AUTODETECT |
47 |
|
45 |
/* File stream used for plugins to write environ vars to */ |
48 |
/* File stream used for plugins to write environ vars to */ |
46 |
FILE *rc_environ_fd = NULL; |
49 |
FILE *rc_environ_fd = NULL; |
47 |
|
50 |
|
Lines 242-249
rc_sys_v2(void)
Link Here
|
242 |
} |
245 |
} |
243 |
librc_hidden_def(rc_sys_v2) |
246 |
librc_hidden_def(rc_sys_v2) |
244 |
|
247 |
|
|
|
248 |
#ifdef ENABLE_COMPAT_RC_SYS_AUTODETECT |
245 |
/* Old sys identification code. |
249 |
/* Old sys identification code. |
246 |
* Not to be used for any binaries outside of openrc. */ |
250 |
* Not to be used for any binaries outside of openrc. |
|
|
251 |
* |
252 |
* The approach of autodetecing rc_sys during runtime is unreliable since |
253 |
* some systems needs /proc to be mounted to be able to detect the system. |
254 |
* Other systems, like LXC have no know way to be autodetected. |
255 |
* |
256 |
* Therefore this code is deprecated and only exists so distros have a |
257 |
* chance to be backwards compatible if they want. |
258 |
* |
259 |
*/ |
247 |
const char * |
260 |
const char * |
248 |
rc_sys_v1(void) |
261 |
rc_sys_v1(void) |
249 |
{ |
262 |
{ |
Lines 292-305
librc_hidden_def(rc_sys_v1)
Link Here
|
292 |
const char * |
305 |
const char * |
293 |
rc_sys(void) |
306 |
rc_sys(void) |
294 |
{ |
307 |
{ |
295 |
if (rc_conf_value("rc_sys")) { |
308 |
/* make sure we dont call the unreliable rc_sys_v1() if rc_sys is |
|
|
309 |
* defined in rc.conf and is not set to "" |
310 |
*/ |
311 |
char *val = rc_conf_value("rc_sys"); |
312 |
if (val && *val) { |
296 |
return rc_sys_v2(); |
313 |
return rc_sys_v2(); |
297 |
} else { |
314 |
} else { |
298 |
return rc_sys_v1(); |
315 |
return rc_sys_v1(); |
299 |
} |
316 |
} |
|
|
317 |
return NULL; |
300 |
} |
318 |
} |
301 |
librc_hidden_def(rc_sys) |
319 |
librc_hidden_def(rc_sys) |
302 |
|
320 |
|
|
|
321 |
#else /* ENABLE_COMPAT_RC_SYS_AUTODETECT */ |
322 |
const char * |
323 |
rc_sys(void) |
324 |
{ |
325 |
return rc_sys_v2(); |
326 |
} |
327 |
#endif /* ENABLE_COMPAT_RC_SYS_AUTODETECT */ |
328 |
|
303 |
static const char * |
329 |
static const char * |
304 |
rc_parse_service_state(RC_SERVICE state) |
330 |
rc_parse_service_state(RC_SERVICE state) |
305 |
{ |
331 |
{ |
306 |
- |
|
|