chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bootchart: parse /etc/os-release rather than system-release
[elogind.git]
/
src
/
rc-local-generator
/
rc-local-generator.c
diff --git
a/src/rc-local-generator/rc-local-generator.c
b/src/rc-local-generator/rc-local-generator.c
index f41a6bf265f9f0a5fdcec807baa0aa10f0ccedc2..448980ba2da7f2a8da701bac5279ec29d9b6648e 100644
(file)
--- a/
src/rc-local-generator/rc-local-generator.c
+++ b/
src/rc-local-generator/rc-local-generator.c
@@
-28,13
+28,13
@@
#include "util.h"
#include "mkdir.h"
#include "util.h"
#include "mkdir.h"
-#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
-#define SCRIPT_PATH_START "/etc/rc.d/rc.local"
-#elif defined(TARGET_SUSE)
-#define SCRIPT_PATH_START "/etc/init.d/boot.local"
+#ifndef RC_LOCAL_SCRIPT_PATH_START
+#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
#endif
#endif
-#define SCRIPT_PATH_STOP "/sbin/halt.local"
+#ifndef RC_LOCAL_SCRIPT_PATH_STOP
+#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local"
+#endif
const char *arg_dest = "/tmp";
const char *arg_dest = "/tmp";
@@
-48,8
+48,7
@@
static int add_symlink(const char *service, const char *where) {
asprintf(&to, "%s/%s.wants/%s", arg_dest, where, service);
if (!from || !to) {
asprintf(&to, "%s/%s.wants/%s", arg_dest, where, service);
if (!from || !to) {
- log_error("Out of memory");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
goto finish;
}
@@
-98,14
+97,14
@@
int main(int argc, char *argv[]) {
umask(0022);
umask(0022);
- if (file_is_executable(SCRIPT_PATH_START)) {
+ if (file_is_executable(
RC_LOCAL_
SCRIPT_PATH_START)) {
log_debug("Automatically adding rc-local.service.");
if (add_symlink("rc-local.service", "multi-user.target") < 0)
r = EXIT_FAILURE;
}
log_debug("Automatically adding rc-local.service.");
if (add_symlink("rc-local.service", "multi-user.target") < 0)
r = EXIT_FAILURE;
}
- if (file_is_executable(SCRIPT_PATH_STOP)) {
+ if (file_is_executable(
RC_LOCAL_
SCRIPT_PATH_STOP)) {
log_debug("Automatically adding halt-local.service.");
if (add_symlink("halt-local.service", "final.target") < 0)
log_debug("Automatically adding halt-local.service.");
if (add_symlink("halt-local.service", "final.target") < 0)