|
|
30a06e7 |
diff --git a/usr/share/rear/rescue/NBU/default/460_prepare_netbackup_systemd.sh b/usr/share/rear/rescue/NBU/default/460_prepare_netbackup_systemd.sh
|
|
|
30a06e7 |
new file mode 100644
|
|
|
30a06e7 |
index 00000000..f7423e0a
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/rescue/NBU/default/460_prepare_netbackup_systemd.sh
|
|
|
30a06e7 |
@@ -0,0 +1,41 @@
|
|
|
30a06e7 |
+# 460_prepare_netbackup_systemd.sh
|
|
|
30a06e7 |
+# prepare systemd units for NBU (only if NBU version >=7.x)
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# set in 450_prepare_netbackup.sh
|
|
|
30a06e7 |
+[[ $NBU_version -lt 7 ]] && return # NBU is using xinetd when version <7.x
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# Skip if systemd is not used.
|
|
|
30a06e7 |
+has_binary systemctl || return 0
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# Local functions that are 'unset' at the end of this script:
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+function get_unit_path () {
|
|
|
30a06e7 |
+ systemctl show -P FragmentPath $1
|
|
|
30a06e7 |
+}
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+function get_unit_dropin_paths () {
|
|
|
30a06e7 |
+ systemctl show -P DropInPaths $1
|
|
|
30a06e7 |
+}
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+local unit_file_path
|
|
|
30a06e7 |
+local i
|
|
|
30a06e7 |
+local unit
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+for unit in vxpbx_exchanged.service netbackup.service ; do
|
|
|
30a06e7 |
+ unit_file_path="$( get_unit_path $unit )"
|
|
|
30a06e7 |
+ if [ -n "$unit_file_path" ]; then
|
|
|
30a06e7 |
+ cp $v "$unit_file_path" $ROOTFS_DIR/etc/systemd/system
|
|
|
30a06e7 |
+ ln -s ../$unit $ROOTFS_DIR/etc/systemd/system/default.target.wants || Error "Failed to enable Netbackup service $unit in the rescue system"
|
|
|
30a06e7 |
+ Log "Enabled Netbackup service $unit in the rescue system"
|
|
|
30a06e7 |
+ for i in $( get_unit_dropin_paths $unit ) ; do
|
|
|
30a06e7 |
+ mkdir -p $ROOTFS_DIR/etc/systemd/system/$unit.d
|
|
|
30a06e7 |
+ cp $v $i $ROOTFS_DIR/etc/systemd/system/$unit.d
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ fi
|
|
|
30a06e7 |
+done
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# Local functions must be 'unset' because bash does not support 'local function ...'
|
|
|
30a06e7 |
+# cf. https://unix.stackexchange.com/questions/104755/how-can-i-create-a-local-function-in-my-bashrc
|
|
|
30a06e7 |
+unset -f get_unit_path
|
|
|
30a06e7 |
+unset -f get_unit_dropin_paths
|
|
|
30a06e7 |
+unset -f unit_is_enabled
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/etc/scripts/run-automatic-rear b/usr/share/rear/skel/default/etc/scripts/run-automatic-rear
|
|
|
30a06e7 |
new file mode 100755
|
|
|
30a06e7 |
index 00000000..6edc657a
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/etc/scripts/run-automatic-rear
|
|
|
30a06e7 |
@@ -0,0 +1,82 @@
|
|
|
30a06e7 |
+#!/bin/bash
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+source /etc/scripts/system-setup-functions.sh
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# In debug mode run the automated 'rear recover' also with debug options.
|
|
|
30a06e7 |
+# Because the kernel command line option 'debug' means 'set -x' for the system setup scripts
|
|
|
30a06e7 |
+# it also means '-D' (i.e. 'set -x') for the automated 'rear recover' run:
|
|
|
30a06e7 |
+if rear_debug ; then
|
|
|
30a06e7 |
+ rear_debug_options='-D'
|
|
|
30a06e7 |
+else
|
|
|
30a06e7 |
+ rear_debug_options=''
|
|
|
30a06e7 |
+fi
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# Launch rear recover automatically:
|
|
|
30a06e7 |
+if automatic_recovery ; then
|
|
|
30a06e7 |
+ choices=( "View Relax-and-Recover log file(s)"
|
|
|
30a06e7 |
+ "Go to Relax-and-Recover shell"
|
|
|
30a06e7 |
+ )
|
|
|
30a06e7 |
+ echo -e "\nLaunching 'rear recover' automatically\n"
|
|
|
30a06e7 |
+ if rear $rear_debug_options recover ; then
|
|
|
30a06e7 |
+ echo -e "\n'rear recover' finished successfully\n"
|
|
|
30a06e7 |
+ choices+=( "Reboot" )
|
|
|
30a06e7 |
+ else
|
|
|
30a06e7 |
+ echo -e "\n'rear recover' failed, check the Relax-and-Recover log file(s)\n"
|
|
|
30a06e7 |
+ fi
|
|
|
30a06e7 |
+ PS3="Select what to do "
|
|
|
30a06e7 |
+ select choice in "${choices[@]}" ; do
|
|
|
30a06e7 |
+ case "$REPLY" in
|
|
|
30a06e7 |
+ (1)
|
|
|
30a06e7 |
+ # Do not assume the ReaR log file is named rear-$HOSTNAME.log
|
|
|
30a06e7 |
+ # the user can have specified any name as LOGFILE:
|
|
|
30a06e7 |
+ less /var/log/rear/*
|
|
|
30a06e7 |
+ ;;
|
|
|
30a06e7 |
+ (2)
|
|
|
30a06e7 |
+ echo "" > /etc/issue
|
|
|
30a06e7 |
+ echo "" > /etc/motd
|
|
|
30a06e7 |
+ break
|
|
|
30a06e7 |
+ ;;
|
|
|
30a06e7 |
+ (3)
|
|
|
30a06e7 |
+ reboot
|
|
|
30a06e7 |
+ ;;
|
|
|
30a06e7 |
+ esac
|
|
|
30a06e7 |
+ for (( i=1 ; i <= ${#choices[@]} ; i++ )) ; do
|
|
|
30a06e7 |
+ echo "$i) ${choices[$i-1]}"
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ done 2>&1
|
|
|
30a06e7 |
+fi
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+# Launch rear recover automatically in unattended mode
|
|
|
30a06e7 |
+# i.e. with automated reboot after successful 'rear recover':
|
|
|
30a06e7 |
+if unattended_recovery ; then
|
|
|
30a06e7 |
+ choices=( "View Relax-and-Recover log file(s)"
|
|
|
30a06e7 |
+ "Go to Relax-and-Recover shell"
|
|
|
30a06e7 |
+ )
|
|
|
30a06e7 |
+ echo -e "\nLaunching 'rear recover' automatically in unattended mode\n"
|
|
|
30a06e7 |
+ if rear $rear_debug_options recover ; then
|
|
|
30a06e7 |
+ echo -e "\n'rear recover' finished successfully\n"
|
|
|
30a06e7 |
+ echo -e "\nRebooting in 30 seconds (Ctrl-C to interrupt)\n"
|
|
|
30a06e7 |
+ sleep 30
|
|
|
30a06e7 |
+ reboot
|
|
|
30a06e7 |
+ else
|
|
|
30a06e7 |
+ echo -e "\n'rear recover' failed, check the Relax-and-Recover log file(s)\n"
|
|
|
30a06e7 |
+ PS3="Select what to do "
|
|
|
30a06e7 |
+ select choice in "${choices[@]}" ; do
|
|
|
30a06e7 |
+ case "$REPLY" in
|
|
|
30a06e7 |
+ (1)
|
|
|
30a06e7 |
+ # Do not assume the ReaR log file is named rear-$HOSTNAME.log
|
|
|
30a06e7 |
+ # the user can have specified any name as LOGFILE:
|
|
|
30a06e7 |
+ less /var/log/rear/*
|
|
|
30a06e7 |
+ ;;
|
|
|
30a06e7 |
+ (2)
|
|
|
30a06e7 |
+ echo "" > /etc/issue
|
|
|
30a06e7 |
+ echo "" > /etc/motd
|
|
|
30a06e7 |
+ break
|
|
|
30a06e7 |
+ ;;
|
|
|
30a06e7 |
+ esac
|
|
|
30a06e7 |
+ for (( i=1 ; i <= ${#choices[@]} ; i++ )) ; do
|
|
|
30a06e7 |
+ echo "$i) ${choices[$i-1]}"
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ done 2>&1
|
|
|
30a06e7 |
+ fi
|
|
|
30a06e7 |
+fi
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/etc/scripts/system-setup b/usr/share/rear/skel/default/etc/scripts/system-setup
|
|
|
30a06e7 |
index 1dc7f1e8..17487ac7 100755
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/etc/scripts/system-setup
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/etc/scripts/system-setup
|
|
|
30a06e7 |
@@ -9,36 +9,7 @@
|
|
|
30a06e7 |
# (e.g. "ls foo*bar" becomes plain "ls" without "foo*bar: No such file or directory" error).
|
|
|
30a06e7 |
shopt -s nullglob
|
|
|
30a06e7 |
|
|
|
30a06e7 |
-# Use an artificial array to get the kernel command line parameters as array elements
|
|
|
30a06e7 |
-kernel_command_line=( $( cat /proc/cmdline ) )
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-function rear_debug() {
|
|
|
30a06e7 |
- for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
- test "debug" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
- done
|
|
|
30a06e7 |
- return 1
|
|
|
30a06e7 |
-}
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-function unattended_recovery() {
|
|
|
30a06e7 |
- for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
- test "unattended" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
- done
|
|
|
30a06e7 |
- return 1
|
|
|
30a06e7 |
-}
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-function automatic_recovery() {
|
|
|
30a06e7 |
- # The unattended recovery mode implies automatic recovery (see the implementations below)
|
|
|
30a06e7 |
- # so that in unattended mode the automatic recovery code below must not be run
|
|
|
30a06e7 |
- # otherwise first the automatic recovery code and then the unattended recovery code
|
|
|
30a06e7 |
- # get run automatically one after the other where the unattended recovery fails
|
|
|
30a06e7 |
- # because for two subsequent 'rear recover' the second one fails:
|
|
|
30a06e7 |
- unattended_recovery && return 1
|
|
|
30a06e7 |
- for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
- test "auto_recover" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
- test "automatic" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
- done
|
|
|
30a06e7 |
- return 1
|
|
|
30a06e7 |
-}
|
|
|
30a06e7 |
+source /etc/scripts/system-setup-functions.sh
|
|
|
30a06e7 |
|
|
|
30a06e7 |
# The 'sleep 1' is used as workaround to avoid whatever inexplicable actual reason
|
|
|
30a06e7 |
# that at least on SLES12 some initial output lines of this script would get lost
|
|
|
30a06e7 |
@@ -135,84 +106,3 @@ echo -e "\nRelax-and-Recover rescue system is ready\n"
|
|
|
30a06e7 |
# Wait two seconds so that the user can read the 'Relax-and-Recover rescue system is ready' message
|
|
|
30a06e7 |
# on his screen before the screen gets cleared and replaced by the login screen:
|
|
|
30a06e7 |
sleep 2
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-# In debug mode run the automated 'rear recover' also with debug options.
|
|
|
30a06e7 |
-# Because the kernel command line option 'debug' means 'set -x' for the system setup scripts
|
|
|
30a06e7 |
-# it also means '-D' (i.e. 'set -x') for the automated 'rear recover' run:
|
|
|
30a06e7 |
-if rear_debug ; then
|
|
|
30a06e7 |
- rear_debug_options='-D'
|
|
|
30a06e7 |
-else
|
|
|
30a06e7 |
- rear_debug_options=''
|
|
|
30a06e7 |
-fi
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-# Launch rear recover automatically:
|
|
|
30a06e7 |
-if automatic_recovery ; then
|
|
|
30a06e7 |
- choices=( "View Relax-and-Recover log file(s)"
|
|
|
30a06e7 |
- "Go to Relax-and-Recover shell"
|
|
|
30a06e7 |
- )
|
|
|
30a06e7 |
- echo -e "\nLaunching 'rear recover' automatically\n"
|
|
|
30a06e7 |
- # The recover workflow is always verbose (see usr/sbin/rear):
|
|
|
30a06e7 |
- if rear $rear_debug_options recover ; then
|
|
|
30a06e7 |
- echo -e "\n'rear recover' finished successfully\n"
|
|
|
30a06e7 |
- choices+=( "Reboot" )
|
|
|
30a06e7 |
- else
|
|
|
30a06e7 |
- echo -e "\n'rear recover' failed, check the Relax-and-Recover log file(s)\n"
|
|
|
30a06e7 |
- fi
|
|
|
30a06e7 |
- PS3="Select what to do "
|
|
|
30a06e7 |
- select choice in "${choices[@]}" ; do
|
|
|
30a06e7 |
- case "$REPLY" in
|
|
|
30a06e7 |
- (1)
|
|
|
30a06e7 |
- # Do not assume the ReaR log file is named rear-$HOSTNAME.log
|
|
|
30a06e7 |
- # the user can have specified any name as LOGFILE:
|
|
|
30a06e7 |
- less /var/log/rear/*
|
|
|
30a06e7 |
- ;;
|
|
|
30a06e7 |
- (2)
|
|
|
30a06e7 |
- echo "" > /etc/issue
|
|
|
30a06e7 |
- echo "" > /etc/motd
|
|
|
30a06e7 |
- break
|
|
|
30a06e7 |
- ;;
|
|
|
30a06e7 |
- (3)
|
|
|
30a06e7 |
- reboot
|
|
|
30a06e7 |
- ;;
|
|
|
30a06e7 |
- esac
|
|
|
30a06e7 |
- for (( i=1 ; i <= ${#choices[@]} ; i++ )) ; do
|
|
|
30a06e7 |
- echo "$i) ${choices[$i-1]}"
|
|
|
30a06e7 |
- done
|
|
|
30a06e7 |
- done 2>&1
|
|
|
30a06e7 |
-fi
|
|
|
30a06e7 |
-
|
|
|
30a06e7 |
-# Launch rear recover automatically in unattended mode
|
|
|
30a06e7 |
-# i.e. with automated reboot after successful 'rear recover':
|
|
|
30a06e7 |
-if unattended_recovery ; then
|
|
|
30a06e7 |
- choices=( "View Relax-and-Recover log file(s)"
|
|
|
30a06e7 |
- "Go to Relax-and-Recover shell"
|
|
|
30a06e7 |
- )
|
|
|
30a06e7 |
- echo -e "\nLaunching 'rear recover' automatically in unattended mode\n"
|
|
|
30a06e7 |
- # The recover workflow is always verbose (see usr/sbin/rear):
|
|
|
30a06e7 |
- if rear $rear_debug_options recover ; then
|
|
|
30a06e7 |
- echo -e "\n'rear recover' finished successfully\n"
|
|
|
30a06e7 |
- echo -e "\nRebooting in 30 seconds (Ctrl-C to interrupt)\n"
|
|
|
30a06e7 |
- sleep 30
|
|
|
30a06e7 |
- reboot
|
|
|
30a06e7 |
- else
|
|
|
30a06e7 |
- echo -e "\n'rear recover' failed, check the Relax-and-Recover log file(s)\n"
|
|
|
30a06e7 |
- PS3="Select what to do "
|
|
|
30a06e7 |
- select choice in "${choices[@]}" ; do
|
|
|
30a06e7 |
- case "$REPLY" in
|
|
|
30a06e7 |
- (1)
|
|
|
30a06e7 |
- # Do not assume the ReaR log file is named rear-$HOSTNAME.log
|
|
|
30a06e7 |
- # the user can have specified any name as LOGFILE:
|
|
|
30a06e7 |
- less /var/log/rear/*
|
|
|
30a06e7 |
- ;;
|
|
|
30a06e7 |
- (2)
|
|
|
30a06e7 |
- echo "" > /etc/issue
|
|
|
30a06e7 |
- echo "" > /etc/motd
|
|
|
30a06e7 |
- break
|
|
|
30a06e7 |
- ;;
|
|
|
30a06e7 |
- esac
|
|
|
30a06e7 |
- for (( i=1 ; i <= ${#choices[@]} ; i++ )) ; do
|
|
|
30a06e7 |
- echo "$i) ${choices[$i-1]}"
|
|
|
30a06e7 |
- done
|
|
|
30a06e7 |
- done 2>&1
|
|
|
30a06e7 |
- fi
|
|
|
30a06e7 |
-fi
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/etc/scripts/system-setup-functions.sh b/usr/share/rear/skel/default/etc/scripts/system-setup-functions.sh
|
|
|
30a06e7 |
new file mode 100644
|
|
|
30a06e7 |
index 00000000..c320cf88
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/etc/scripts/system-setup-functions.sh
|
|
|
30a06e7 |
@@ -0,0 +1,30 @@
|
|
|
30a06e7 |
+# Use an artificial array to get the kernel command line parameters as array elements
|
|
|
30a06e7 |
+kernel_command_line=( $( cat /proc/cmdline ) )
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+function rear_debug() {
|
|
|
30a06e7 |
+ for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
+ test "debug" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ return 1
|
|
|
30a06e7 |
+}
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+function unattended_recovery() {
|
|
|
30a06e7 |
+ for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
+ test "unattended" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ return 1
|
|
|
30a06e7 |
+}
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+function automatic_recovery() {
|
|
|
30a06e7 |
+ # The unattended recovery mode implies automatic recovery (see the implementations below)
|
|
|
30a06e7 |
+ # so that in unattended mode the automatic recovery code below must not be run
|
|
|
30a06e7 |
+ # otherwise first the automatic recovery code and then the unattended recovery code
|
|
|
30a06e7 |
+ # get run automatically one after the other where the unattended recovery fails
|
|
|
30a06e7 |
+ # because for two subsequent 'rear recover' the second one fails:
|
|
|
30a06e7 |
+ unattended_recovery && return 1
|
|
|
30a06e7 |
+ for kernel_command_line_parameter in "${kernel_command_line[@]}" ; do
|
|
|
30a06e7 |
+ test "auto_recover" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
+ test "automatic" = "$kernel_command_line_parameter" && return 0
|
|
|
30a06e7 |
+ done
|
|
|
30a06e7 |
+ return 1
|
|
|
30a06e7 |
+}
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/etc/systemd/system/default.target.wants/.gitignore b/usr/share/rear/skel/default/etc/systemd/system/default.target.wants/.gitignore
|
|
|
30a06e7 |
new file mode 100644
|
|
|
30a06e7 |
index 00000000..d6b7ef32
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/etc/systemd/system/default.target.wants/.gitignore
|
|
|
30a06e7 |
@@ -0,0 +1,2 @@
|
|
|
30a06e7 |
+*
|
|
|
30a06e7 |
+!.gitignore
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/automatic-rear.service b/usr/share/rear/skel/default/usr/lib/systemd/system/automatic-rear.service
|
|
|
30a06e7 |
new file mode 100644
|
|
|
30a06e7 |
index 00000000..ee3187a8
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/automatic-rear.service
|
|
|
30a06e7 |
@@ -0,0 +1,13 @@
|
|
|
30a06e7 |
+[Unit]
|
|
|
30a06e7 |
+Description=Run Relax-and-Recover recovery automatically if requested
|
|
|
30a06e7 |
+Wants=network-online.target
|
|
|
30a06e7 |
+After=network-online.target
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+[Service]
|
|
|
30a06e7 |
+Type=oneshot
|
|
|
30a06e7 |
+ExecStart=/etc/scripts/run-automatic-rear
|
|
|
30a06e7 |
+StandardInput=tty
|
|
|
30a06e7 |
+RemainAfterExit=yes
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+[Install]
|
|
|
30a06e7 |
+WantedBy=multi-user.target
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/getty@.service b/usr/share/rear/skel/default/usr/lib/systemd/system/getty@.service
|
|
|
30a06e7 |
index bf858ca8..abafd8b5 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/getty@.service
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/getty@.service
|
|
|
30a06e7 |
@@ -6,6 +6,8 @@ Description=Getty on %I
|
|
|
30a06e7 |
Documentation=man:agetty(8)
|
|
|
30a06e7 |
After=systemd-user-sessions.service plymouth-quit-wait.service
|
|
|
30a06e7 |
After=sysinit.service
|
|
|
30a06e7 |
+# Automatic ReaR uses the system console
|
|
|
30a06e7 |
+After=automatic-rear.service
|
|
|
30a06e7 |
|
|
|
30a06e7 |
# If additional gettys are spawned during boot then we should make
|
|
|
30a06e7 |
# sure that this is synchronized before getty.target, even though
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target b/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target
|
|
|
30a06e7 |
index c5ea1cca..a88e219f 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target
|
|
|
30a06e7 |
@@ -4,7 +4,7 @@
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Unit]
|
|
|
30a06e7 |
Description=Multi-User
|
|
|
30a06e7 |
-Requires=sysinit.target
|
|
|
30a06e7 |
+Requires=sysinit.target basic.target
|
|
|
30a06e7 |
AllowIsolate=yes
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Install]
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target.wants/automatic-rear.service b/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target.wants/automatic-rear.service
|
|
|
30a06e7 |
new file mode 120000
|
|
|
30a06e7 |
index 00000000..3e8a4161
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/multi-user.target.wants/automatic-rear.service
|
|
|
30a06e7 |
@@ -0,0 +1 @@
|
|
|
30a06e7 |
+../automatic-rear.service
|
|
|
30a06e7 |
\ No newline at end of file
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target b/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target
|
|
|
30a06e7 |
new file mode 100644
|
|
|
30a06e7 |
index 00000000..c3edfeb4
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target
|
|
|
30a06e7 |
@@ -0,0 +1,14 @@
|
|
|
30a06e7 |
+# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
30a06e7 |
+#
|
|
|
30a06e7 |
+# This file is part of systemd.
|
|
|
30a06e7 |
+#
|
|
|
30a06e7 |
+# systemd is free software; you can redistribute it and/or modify it
|
|
|
30a06e7 |
+# under the terms of the GNU Lesser General Public License as published by
|
|
|
30a06e7 |
+# the Free Software Foundation; either version 2.1 of the License, or
|
|
|
30a06e7 |
+# (at your option) any later version.
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+[Unit]
|
|
|
30a06e7 |
+Description=Network is Online
|
|
|
30a06e7 |
+Documentation=man:systemd.special(7)
|
|
|
30a06e7 |
+Documentation=https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
|
|
|
30a06e7 |
+After=network.target
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target.wants/sysinit.service b/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target.wants/sysinit.service
|
|
|
30a06e7 |
new file mode 120000
|
|
|
30a06e7 |
index 00000000..ed660a10
|
|
|
30a06e7 |
--- /dev/null
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/network-online.target.wants/sysinit.service
|
|
|
30a06e7 |
@@ -0,0 +1 @@
|
|
|
30a06e7 |
+../sysinit.service
|
|
|
30a06e7 |
\ No newline at end of file
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/rsyslog.service b/usr/share/rear/skel/default/usr/lib/systemd/system/rsyslog.service
|
|
|
30a06e7 |
index ac171e0f..18fa17b5 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/rsyslog.service
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/rsyslog.service
|
|
|
30a06e7 |
@@ -1,6 +1,5 @@
|
|
|
30a06e7 |
[Unit]
|
|
|
30a06e7 |
Description=Relax-and-Recover run-syslog script
|
|
|
30a06e7 |
-DefaultDependencies=no
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Service]
|
|
|
30a06e7 |
Type=simple
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service b/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service
|
|
|
30a06e7 |
index ee22fafc..b34b2fe8 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service
|
|
|
30a06e7 |
@@ -1,9 +1,14 @@
|
|
|
30a06e7 |
[Unit]
|
|
|
30a06e7 |
Description=Initialize Rescue System
|
|
|
30a06e7 |
-After=systemd-udevd.service
|
|
|
30a06e7 |
+DefaultDependencies=no
|
|
|
30a06e7 |
+After=systemd-udevd.service rear-boot-helper.service
|
|
|
30a06e7 |
+Before=network-online.target
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Service]
|
|
|
30a06e7 |
Type=oneshot
|
|
|
30a06e7 |
ExecStart=/etc/scripts/system-setup
|
|
|
30a06e7 |
StandardInput=tty
|
|
|
30a06e7 |
RemainAfterExit=yes
|
|
|
30a06e7 |
+
|
|
|
30a06e7 |
+[Install]
|
|
|
30a06e7 |
+WantedBy=network-online.target
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.target b/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.target
|
|
|
30a06e7 |
index 4187ef67..2a16369b 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.target
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.target
|
|
|
30a06e7 |
@@ -4,3 +4,5 @@
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Unit]
|
|
|
30a06e7 |
Description=System Initialization
|
|
|
30a06e7 |
+Wants=sysinit.service rear-boot-helper.service
|
|
|
30a06e7 |
+After=sysinit.service rear-boot-helper.service
|
|
|
30a06e7 |
diff --git a/usr/share/rear/skel/default/usr/lib/systemd/system/syslog.socket b/usr/share/rear/skel/default/usr/lib/systemd/system/syslog.socket
|
|
|
30a06e7 |
index 9a0064c0..3fb02344 100644
|
|
|
30a06e7 |
--- a/usr/share/rear/skel/default/usr/lib/systemd/system/syslog.socket
|
|
|
30a06e7 |
+++ b/usr/share/rear/skel/default/usr/lib/systemd/system/syslog.socket
|
|
|
30a06e7 |
@@ -4,7 +4,6 @@
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Unit]
|
|
|
30a06e7 |
Description=Syslog Socket
|
|
|
30a06e7 |
-DefaultDependencies=no
|
|
|
30a06e7 |
Before=sockets.target syslog.target
|
|
|
30a06e7 |
|
|
|
30a06e7 |
[Socket]
|