chiark / gitweb /
bus: properly handle if new objects are installed in the node tree while we are dispa...
[elogind.git] / src / rc-local-generator / rc-local-generator.c
index c219e77..9265501 100644 (file)
 #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
 
-#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";
 
@@ -59,7 +59,7 @@ static int add_symlink(const char *service, const char *where) {
                 if (errno == EEXIST)
                         r = 0;
                 else {
-                        log_error("Failed to create symlink from %s to %s: %m", from, to);
+                        log_error("Failed to create symlink %s: %m", to);
                         r = -errno;
                 }
         }
@@ -97,14 +97,14 @@ int main(int argc, char *argv[]) {
 
         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;
         }
 
-        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)