summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am41
-rw-r--r--configure.ac21
-rw-r--r--src/rc-local-generator/rc-local-generator.c14
-rw-r--r--units/.gitignore2
l---------units/fedora/Makefile1
-rw-r--r--units/halt-local.service.in (renamed from units/fedora/halt-local.service)6
-rw-r--r--units/rc-local.service.in (renamed from units/fedora/rc-local.service)7
-rw-r--r--units/suse/halt-local.service20
-rw-r--r--units/suse/rc-local.service19
9 files changed, 46 insertions, 85 deletions
diff --git a/Makefile.am b/Makefile.am
index 94ae549b8f..9132ccdfc3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -406,34 +406,15 @@ EXTRA_DIST += \
units/systemd-modules-load.service.in
endif
-if TARGET_FEDORA
-dist_systemunit_DATA += \
- units/fedora/rc-local.service \
- units/fedora/halt-local.service
-systemgenerator_PROGRAMS += \
- systemd-rc-local-generator
-endif
-
-if TARGET_MANDRIVA
-dist_systemunit_DATA += \
- units/fedora/rc-local.service \
- units/fedora/halt-local.service
-systemgenerator_PROGRAMS += \
- systemd-rc-local-generator
-endif
+if HAVE_SYSV_COMPAT
+nodist_systemunit_DATA += \
+ units/rc-local.service \
+ units/halt-local.service
-if TARGET_SUSE
-dist_systemunit_DATA += \
- units/suse/rc-local.service \
- units/suse/halt-local.service
-systemgenerator_PROGRAMS += \
- systemd-rc-local-generator
-endif
+EXTRA_DIST += \
+ units/rc-local.service.in \
+ units/halt-local.service.in
-if TARGET_MAGEIA
-dist_systemunit_DATA += \
- units/fedora/rc-local.service \
- units/fedora/halt-local.service
systemgenerator_PROGRAMS += \
systemd-rc-local-generator
endif
@@ -3856,6 +3837,8 @@ SED_PROCESS = \
-e 's,@QUOTACHECK\@,$(QUOTACHECK),g' \
-e 's,@SYSTEM_SYSVINIT_PATH\@,$(sysvinitdir),g' \
-e 's,@VARLOGDIR\@,$(varlogdir),g' \
+ -e 's,@RC_LOCAL_SCRIPT_PATH_START\@,$(RC_LOCAL_SCRIPT_PATH_START),g' \
+ -e 's,@RC_LOCAL_SCRIPT_PATH_STOP\@,$(RC_LOCAL_SCRIPT_PATH_STOP),g' \
< $< > $@
units/%: units/%.in Makefile
@@ -4133,12 +4116,6 @@ if TARGET_MANDRIVA
$(LN_S) rescue.service single.service )
endif
-if TARGET_SUSE
- ( cd $(DESTDIR)$(systemunitdir) && \
- rm -f local.service && \
- $(LN_S) rc-local.service local.service )
-endif
-
if TARGET_MAGEIA
( cd $(DESTDIR)$(systemunitdir) && \
rm -f display-manager.service )
diff --git a/configure.ac b/configure.ac
index d0003bb5bd..92dbdf5a30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -589,6 +589,25 @@ fi
AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
# ------------------------------------------------------------------------------
+AC_ARG_WITH(rc-local-script-path-start,
+ AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
+ [Path to /etc/rc.local]),
+ [RC_LOCAL_SCRIPT_PATH_START="$withval"],
+ [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
+
+AC_ARG_WITH(rc-local-script-path-stop,
+ AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
+ [Path to /sbin/halt.local]),
+ [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
+ [RC_LOCAL_SCRIPT_PATH_STOP="/sbin/halt.local"])
+
+AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
+AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /sbin/halt.local script])
+
+AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
+AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
+
+# ------------------------------------------------------------------------------
AC_ARG_WITH(firmware-path,
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
[Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
@@ -889,6 +908,8 @@ AC_MSG_RESULT([
Split /usr: ${enable_split_usr}
man pages: ${have_manpages}
gtk-doc: ${enable_gtk_doc}
+ Extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
+ Extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
CPPLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c
index c219e77047..448980ba2d 100644
--- 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"
-#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";
@@ -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)
diff --git a/units/.gitignore b/units/.gitignore
index 63c7ba06bb..5e86d30113 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -1,3 +1,5 @@
+/halt-local.service
+/rc-local.service
/systemd-hybrid-sleep.service
/systemd-journal-gatewayd.service
/systemd-journal-flush.service
diff --git a/units/fedora/Makefile b/units/fedora/Makefile
deleted file mode 120000
index 50be21181f..0000000000
--- a/units/fedora/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../src/Makefile \ No newline at end of file
diff --git a/units/fedora/halt-local.service b/units/halt-local.service.in
index a0a3a292e7..c8be8965a3 100644
--- a/units/fedora/halt-local.service
+++ b/units/halt-local.service.in
@@ -6,15 +6,15 @@
# (at your option) any later version.
[Unit]
-Description=/sbin/halt.local Compatibility
-ConditionFileIsExecutable=/sbin/halt.local
+Description=@RC_LOCAL_SCRIPT_PATH_STOP@ Compatibility
+ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_STOP@
DefaultDependencies=no
After=shutdown.target
Before=final.target
[Service]
Type=oneshot
-ExecStart=/sbin/halt.local
+ExecStart=@RC_LOCAL_SCRIPT_PATH_STOP@
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
diff --git a/units/fedora/rc-local.service b/units/rc-local.service.in
index 3b3bda9f6f..97d44a7a27 100644
--- a/units/fedora/rc-local.service
+++ b/units/rc-local.service.in
@@ -6,14 +6,15 @@
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
-# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
+# systemd-rc-local-generator if @RC_LOCAL_SCRIPT_PATH_START@ is executable.
[Unit]
-Description=/etc/rc.d/rc.local Compatibility
+Description=@RC_LOCAL_SCRIPT_PATH_START@ Compatibility
+ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_START@
After=network.target
[Service]
Type=forking
-ExecStart=/etc/rc.d/rc.local start
+ExecStart=@RC_LOCAL_SCRIPT_PATH_START@ start
TimeoutSec=0
RemainAfterExit=yes
SysVStartPriority=99
diff --git a/units/suse/halt-local.service b/units/suse/halt-local.service
deleted file mode 100644
index 3a3a7930e2..0000000000
--- a/units/suse/halt-local.service
+++ /dev/null
@@ -1,20 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=/etc/init.d/halt.local Compatibility
-ConditionFileIsExecutable=/etc/init.d/halt.local
-DefaultDependencies=no
-After=shutdown.target
-Before=final.target
-
-[Service]
-Type=oneshot
-ExecStart=/etc/init.d/halt.local
-TimeoutSec=0
-StandardOutput=tty
-RemainAfterExit=yes
diff --git a/units/suse/rc-local.service b/units/suse/rc-local.service
deleted file mode 100644
index 0fd70e0fc9..0000000000
--- a/units/suse/rc-local.service
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-# This unit gets pulled automatically into multi-user.target by
-# systemd-rc-local-generator if /etc/init.d/boot.local is executable.
-[Unit]
-Description=/etc/init.d/boot.local Compatibility
-After=network.target
-
-[Service]
-Type=oneshot
-ExecStart=/etc/init.d/boot.local
-TimeoutSec=0
-RemainAfterExit=yes
-SysVStartPriority=99