diff --git a/after-local.service b/after-local.service deleted file mode 100644 index 500c2370..00000000 --- a/after-local.service +++ /dev/null @@ -1,17 +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 General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -[Unit] -Description=/etc/init.d/after.local Compatibility -ConditionFileIsExecutable=/etc/init.d/after.local -After=getty.target - -[Service] -Type=idle -ExecStart=/etc/init.d/after.local -TimeoutSec=0 -RemainAfterExit=yes diff --git a/files.systemd b/files.systemd index 56241dc4..537a3980 100644 --- a/files.systemd +++ b/files.systemd @@ -472,7 +472,6 @@ %{_udevrulesdir}/71-seat.rules %{_udevrulesdir}/73-seat-late.rules %{_udevrulesdir}/99-systemd.rules -%{_unitdir}/after-local.service %{_unitdir}/autovt@.service %{_unitdir}/basic.target %{_unitdir}/blockdev@.target @@ -515,7 +514,6 @@ %{_unitdir}/local-fs.target.wants/tmp.mount %{_unitdir}/modprobe@.service %{_unitdir}/multi-user.target -%{_unitdir}/multi-user.target.wants/after-local.service %{_unitdir}/multi-user.target.wants/getty.target %{_unitdir}/multi-user.target.wants/systemd-logind.service %{_unitdir}/multi-user.target.wants/systemd-user-sessions.service diff --git a/fixlet-systemd-post.sh b/fixlet-systemd-post.sh index 7a111937..1ddb654d 100644 --- a/fixlet-systemd-post.sh +++ b/fixlet-systemd-post.sh @@ -131,6 +131,7 @@ migrate_language () { fi } +# # Migrate old i18n settings previously configured in /etc/sysconfig to the new # locations used by systemd (/etc/locale.conf, /etc/vconsole.conf, ...). Recent # versions of systemd parse the new locations only. @@ -139,7 +140,8 @@ migrate_language () { # might be upgrading from a system which was running SysV init (systemd package # is being installed). # -# It's run only once. +# Note: run only once. +# migrate_sysconfig_i18n() { local tagfile=/var/lib/systemd/rpm/systemd-i18n_migrated local -i rv=0 @@ -258,11 +260,28 @@ fix_issue_11329() { fi } +# +# We don't ship after-local.service anymore however as a courtesy we install a +# copy in /etc for users who are relying on it. +# +# Note: should run only once since it is conditionalized on the presence of +# %{_unitdir}/after-local.service +# +drop_after_local_support() { + if [ -x /etc/init.d/after.local ] && + [ -f /usr/lib/systemd/system/after-local.service ]; then + echo "after-local.service is no more provided by systemd but a copy has been installed in /etc" + cp /usr/lib/systemd/system/after-local.service /etc/systemd/system/ + ln -s ../after-local.service /etc/systemd/system/multi-user.target.wants/after-local.service + fi +} + r=0 fix_machine_id_perms || r=1 fix_pre_210 || r=1 migrate_sysconfig_i18n || r=1 fix_bsc_1020601 || r=1 fix_issue_11329 || r=1 +drop_after_local_support || r=1 exit $r diff --git a/systemd.changes b/systemd.changes index 752e342a..d156a94e 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Sep 12 19:24:02 UTC 2023 - Franck Bui + +- Don't ship after-local.service anymore. This was mostly a hack for people + wanting to execute any random things once the boot was finished. We shouldn't + encourage such practice and it actually conflicts with the sysv-generator + which believes that /etc/init.d/after.local is SysV init script that needs to + be converted into a native unit file. + + We still install a copy of this service in /etc if the user is relying on + it, for backward compatibility. + ------------------------------------------------------------------- Tue Sep 12 18:28:07 UTC 2023 - Franck Bui diff --git a/systemd.spec b/systemd.spec index da681338..78677eb4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -171,7 +171,6 @@ Source4: systemd-sysv-install Source5: tmpfiles-suse.conf Source6: baselibs.conf Source7: triggers.systemd -Source11: after-local.service Source14: kbd-model-map.legacy Source100: fixlet-container-post.sh @@ -922,10 +921,6 @@ mkdir -p %{buildroot}%{_userpresetdir} mkdir -p %{buildroot}%{_systemd_system_env_generator_dir} mkdir -p %{buildroot}%{_systemd_user_env_generator_dir} -# Ensure after.local wrapper is called. -install -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/ -ln -s ../after-local.service %{buildroot}%{_unitdir}/multi-user.target.wants/ - # ghost directories with default permissions. mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/backlight @@ -1069,7 +1064,7 @@ if [ $1 -gt 1 ]; then %systemd_post systemd-userdbd.socket fi -# Run the hacks/fixups to clean up old garbages left by (very) old versions of +# Run the hacks/fixups to clean up the old stuff left by (very) old versions of # systemd. %{_systemd_util_dir}/rpm/fixlet-systemd-post.sh $1 || :