build-sys: make rc-local support part of SYSV compat
This also drops automatic selection of the rc local scripts based on the local distro. Distributions now should specify the paths of the rc-local and halt-local scripts on the configure command line.
This commit is contained in:
parent
46a2911bf2
commit
b1c4ca25bf
41
Makefile.am
41
Makefile.am
|
@ -406,34 +406,15 @@ EXTRA_DIST += \
|
||||||
units/systemd-modules-load.service.in
|
units/systemd-modules-load.service.in
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if TARGET_FEDORA
|
if HAVE_SYSV_COMPAT
|
||||||
dist_systemunit_DATA += \
|
nodist_systemunit_DATA += \
|
||||||
units/fedora/rc-local.service \
|
units/rc-local.service \
|
||||||
units/fedora/halt-local.service
|
units/halt-local.service
|
||||||
systemgenerator_PROGRAMS += \
|
|
||||||
systemd-rc-local-generator
|
|
||||||
endif
|
|
||||||
|
|
||||||
if TARGET_MANDRIVA
|
EXTRA_DIST += \
|
||||||
dist_systemunit_DATA += \
|
units/rc-local.service.in \
|
||||||
units/fedora/rc-local.service \
|
units/halt-local.service.in
|
||||||
units/fedora/halt-local.service
|
|
||||||
systemgenerator_PROGRAMS += \
|
|
||||||
systemd-rc-local-generator
|
|
||||||
endif
|
|
||||||
|
|
||||||
if TARGET_SUSE
|
|
||||||
dist_systemunit_DATA += \
|
|
||||||
units/suse/rc-local.service \
|
|
||||||
units/suse/halt-local.service
|
|
||||||
systemgenerator_PROGRAMS += \
|
|
||||||
systemd-rc-local-generator
|
|
||||||
endif
|
|
||||||
|
|
||||||
if TARGET_MAGEIA
|
|
||||||
dist_systemunit_DATA += \
|
|
||||||
units/fedora/rc-local.service \
|
|
||||||
units/fedora/halt-local.service
|
|
||||||
systemgenerator_PROGRAMS += \
|
systemgenerator_PROGRAMS += \
|
||||||
systemd-rc-local-generator
|
systemd-rc-local-generator
|
||||||
endif
|
endif
|
||||||
|
@ -3856,6 +3837,8 @@ SED_PROCESS = \
|
||||||
-e 's,@QUOTACHECK\@,$(QUOTACHECK),g' \
|
-e 's,@QUOTACHECK\@,$(QUOTACHECK),g' \
|
||||||
-e 's,@SYSTEM_SYSVINIT_PATH\@,$(sysvinitdir),g' \
|
-e 's,@SYSTEM_SYSVINIT_PATH\@,$(sysvinitdir),g' \
|
||||||
-e 's,@VARLOGDIR\@,$(varlogdir),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
|
units/%: units/%.in Makefile
|
||||||
|
@ -4133,12 +4116,6 @@ if TARGET_MANDRIVA
|
||||||
$(LN_S) rescue.service single.service )
|
$(LN_S) rescue.service single.service )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if TARGET_SUSE
|
|
||||||
( cd $(DESTDIR)$(systemunitdir) && \
|
|
||||||
rm -f local.service && \
|
|
||||||
$(LN_S) rc-local.service local.service )
|
|
||||||
endif
|
|
||||||
|
|
||||||
if TARGET_MAGEIA
|
if TARGET_MAGEIA
|
||||||
( cd $(DESTDIR)$(systemunitdir) && \
|
( cd $(DESTDIR)$(systemunitdir) && \
|
||||||
rm -f display-manager.service )
|
rm -f display-manager.service )
|
||||||
|
|
21
configure.ac
21
configure.ac
|
@ -588,6 +588,25 @@ if test "x$enable_coredump" != "xno"; then
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
|
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,
|
AC_ARG_WITH(firmware-path,
|
||||||
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
|
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
|
||||||
|
@ -889,6 +908,8 @@ AC_MSG_RESULT([
|
||||||
Split /usr: ${enable_split_usr}
|
Split /usr: ${enable_split_usr}
|
||||||
man pages: ${have_manpages}
|
man pages: ${have_manpages}
|
||||||
gtk-doc: ${enable_gtk_doc}
|
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}
|
CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
|
||||||
CPPLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
|
CPPLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
|
|
||||||
#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
|
#ifndef RC_LOCAL_SCRIPT_PATH_START
|
||||||
#define SCRIPT_PATH_START "/etc/rc.d/rc.local"
|
#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
|
||||||
#elif defined(TARGET_SUSE)
|
|
||||||
#define SCRIPT_PATH_START "/etc/init.d/boot.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";
|
||||||
|
|
||||||
|
@ -97,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.");
|
log_debug("Automatically adding rc-local.service.");
|
||||||
|
|
||||||
if (add_symlink("rc-local.service", "multi-user.target") < 0)
|
if (add_symlink("rc-local.service", "multi-user.target") < 0)
|
||||||
r = EXIT_FAILURE;
|
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.");
|
log_debug("Automatically adding halt-local.service.");
|
||||||
|
|
||||||
if (add_symlink("halt-local.service", "final.target") < 0)
|
if (add_symlink("halt-local.service", "final.target") < 0)
|
||||||
|
|
2
units/.gitignore
vendored
2
units/.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
/halt-local.service
|
||||||
|
/rc-local.service
|
||||||
/systemd-hybrid-sleep.service
|
/systemd-hybrid-sleep.service
|
||||||
/systemd-journal-gatewayd.service
|
/systemd-journal-gatewayd.service
|
||||||
/systemd-journal-flush.service
|
/systemd-journal-flush.service
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../../src/Makefile
|
|
|
@ -6,15 +6,15 @@
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=/sbin/halt.local Compatibility
|
Description=@RC_LOCAL_SCRIPT_PATH_STOP@ Compatibility
|
||||||
ConditionFileIsExecutable=/sbin/halt.local
|
ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_STOP@
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=shutdown.target
|
After=shutdown.target
|
||||||
Before=final.target
|
Before=final.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/sbin/halt.local
|
ExecStart=@RC_LOCAL_SCRIPT_PATH_STOP@
|
||||||
TimeoutSec=0
|
TimeoutSec=0
|
||||||
StandardOutput=tty
|
StandardOutput=tty
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
|
@ -6,14 +6,15 @@
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
# This unit gets pulled automatically into multi-user.target by
|
# 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]
|
[Unit]
|
||||||
Description=/etc/rc.d/rc.local Compatibility
|
Description=@RC_LOCAL_SCRIPT_PATH_START@ Compatibility
|
||||||
|
ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_START@
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=/etc/rc.d/rc.local start
|
ExecStart=@RC_LOCAL_SCRIPT_PATH_START@ start
|
||||||
TimeoutSec=0
|
TimeoutSec=0
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
SysVStartPriority=99
|
SysVStartPriority=99
|
|
@ -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
|
|
|
@ -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
|
|
Loading…
Reference in a new issue