Package systemd: Скрипты
Post install
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | systemd-machine-id-setup >/dev/null 2>&1 || : systemctl daemon-reexec &>/dev/null || { # systemd v239 had bug #9553 in D-Bus authentication of the private socket, # which was later fixed in v240 by #9625. # # The end result is that a `systemctl daemon-reexec` call as root will fail # when upgrading from systemd v239, which means the system will not start # running the new version of systemd after this post install script runs. # # To work around this issue, let's fall back to using a `kill -TERM 1` to # re-execute the daemon when the `systemctl daemon-reexec` call fails. # # In order to prevent issues when the reason why the daemon-reexec failed is # not the aforementioned bug, let's only use this fallback when: # - we're upgrading this RPM package; and # - we confirm that systemd is running as PID1 on this system. if [ $1 -gt 1 ] && [ -d /run/systemd/system ] ; then kill -TERM 1 &>/dev/null || : fi } # Move old stuff around in /var/lib [ -d /var/lib/systemd/random-seed ] && rm -rf /var/lib/systemd/random-seed >/dev/null 2>&1 || : [ -e /var/lib/random-seed ] && mv /var/lib/random-seed /var/lib/systemd/random-seed >/dev/null 2>&1 || : [ -e /var/lib/backlight ] && mv /var/lib/backlight /var/lib/systemd/backlight >/dev/null 2>&1 || : /lib/systemd/systemd-random-seed save >/dev/null 2>&1 || : # rm symlinks for network.service [ -L /etc/systemd/system/network.target.wants/network.service ] && rm -f /etc/systemd/system/network.target.wants/network.service >/dev/null 2>&1 || : [ -L /etc/systemd/system/multi-user.target.wants/network.service ] && rm -f /etc/systemd/system/multi-user.target.wants/network.service >/dev/null 2>&1 || : # rm symlinks for prefdm.service [ -L /etc/systemd/system/graphical.target.wants/prefdm.service ] && rm -f /etc/systemd/system/graphical.target.wants/prefdm.service >/dev/null 2>&1 || : if [ $1 -eq 1 ] ; then # create /var/log/journal only on initial installation mkdir -p /var/log/journal fi # Make sure new journal files will be owned by the "systemd-journal" group chgrp systemd-journal /run/log/journal/ /run/log/journal/`cat /etc/machine-id 2> /dev/null` /var/log/journal/ /var/log/journal/`cat /etc/machine-id 2> /dev/null` >/dev/null 2>&1 || : chmod g+s /run/log/journal/ /run/log/journal/`cat /etc/machine-id 2> /dev/null` /var/log/journal/ /var/log/journal/`cat /etc/machine-id 2> /dev/null` >/dev/null 2>&1 || : # Apply ACL to the journal directory setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ >/dev/null 2>&1 || : # remove obsolete systemd-readahead file and services symlink rm -f /.readahead > /dev/null 2>&1 || : [ -L /etc/systemd/system/default.target.wants/systemd-readahead-collect.service ] && rm -f /etc/systemd/system/default.target.wants/systemd-readahead-collect.service [ -L /etc/systemd/system/default.target.wants/systemd-readahead-replay.service ] && rm -f /etc/systemd/system/default.target.wants/systemd-readahead-replay.service [ -L /etc/systemd/system/system-update.target.wants/systemd-readahead-drop.service ] && rm -f /etc/systemd/system/system-update.target.wants/systemd-readahead-drop.service if [ $1 -eq 1 ] ; then # Enable the services we install by default systemctl preset-all >/dev/null 2>&1 || : systemctl --global preset-all >/dev/null 2>&1 || : fi # Migrate /etc/sysconfig/clock SYSCONFIG_CLOCK=/etc/sysconfig/clock if [ ! -L /etc/localtime -a -e "$SYSCONFIG_CLOCK" ] ; then . "$SYSCONFIG_CLOCK" >/dev/null 2>&1 || : if [ -n "$ZONE" -a -e "/usr/share/zoneinfo/$ZONE" ] ; then ln -sf "../usr/share/zoneinfo/$ZONE" /etc/localtime >/dev/null 2>&1 || : fi fi #rm -f "$SYSCONFIG_CLOCK" >/dev/null 2>&1 || : # Migrate /etc/sysconfig/i18n SYSCONFIG_I18N=/etc/sysconfig/i18n if [ -e "$SYSCONFIG_I18N" -a ! -e /etc/locale.conf ]; then unset LANG unset LC_CTYPE unset LC_NUMERIC unset LC_TIME unset LC_COLLATE unset LC_MONETARY unset LC_MESSAGES unset LC_PAPER unset LC_NAME unset LC_ADDRESS unset LC_TELEPHONE unset LC_MEASUREMENT unset LC_IDENTIFICATION . "$SYSCONFIG_I18N" >/dev/null 2>&1 || : [ -n "$LANG" ] && echo LANG=$LANG > /etc/locale.conf 2>&1 || : [ -n "$LC_CTYPE" ] && echo LC_CTYPE=$LC_CTYPE >> /etc/locale.conf 2>&1 || : [ -n "$LC_NUMERIC" ] && echo LC_NUMERIC=$LC_NUMERIC >> /etc/locale.conf 2>&1 || : [ -n "$LC_TIME" ] && echo LC_TIME=$LC_TIME >> /etc/locale.conf 2>&1 || : [ -n "$LC_COLLATE" ] && echo LC_COLLATE=$LC_COLLATE >> /etc/locale.conf 2>&1 || : [ -n "$LC_MONETARY" ] && echo LC_MONETARY=$LC_MONETARY >> /etc/locale.conf 2>&1 || : [ -n "$LC_MESSAGES" ] && echo LC_MESSAGES=$LC_MESSAGES >> /etc/locale.conf 2>&1 || : [ -n "$LC_PAPER" ] && echo LC_PAPER=$LC_PAPER >> /etc/locale.conf 2>&1 || : [ -n "$LC_NAME" ] && echo LC_NAME=$LC_NAME >> /etc/locale.conf 2>&1 || : [ -n "$LC_ADDRESS" ] && echo LC_ADDRESS=$LC_ADDRESS >> /etc/locale.conf 2>&1 || : [ -n "$LC_TELEPHONE" ] && echo LC_TELEPHONE=$LC_TELEPHONE >> /etc/locale.conf 2>&1 || : [ -n "$LC_MEASUREMENT" ] && echo LC_MEASUREMENT=$LC_MEASUREMENT >> /etc/locale.conf 2>&1 || : [ -n "$LC_IDENTIFICATION" ] && echo LC_IDENTIFICATION=$LC_IDENTIFICATION >> /etc/locale.conf 2>&1 || : fi #rm -f "$SYSCONFIG_I18N" >/dev/null 2>&1 || : # Migrate /etc/sysconfig/keyboard and /etc/sysconfig/consolefont SYSCONFIG_KEYBOARD=/etc/sysconfig/keyboard SYSCONFIG_CONSOLEFONT=/etc/sysconfig/consolefont if [ -e "$SYSCONFIG_KEYBOARD" -a -e "$SYSCONFIG_CONSOLEFONT" -a ! -e /etc/vconsole.conf ]; then unset SYSFONT unset SYSFONTACM unset UNIMAP unset KEYTABLE [ -e "$SYSCONFIG_KEYBOARD" ] && . "$SYSCONFIG_KEYBOARD" >/dev/null 2>&1 || : [ -e "$SYSCONFIG_CONSOLEFONT" ] && . "$SYSCONFIG_CONSOLEFONT" >/dev/null 2>&1 || : [ -n "$SYSFONT" ] && echo FONT=$SYSFONT > /etc/vconsole.conf 2>&1 || : [ -n "$SYSFONTACM" ] && echo FONT_MAP=$SYSFONTACM >> /etc/vconsole.conf 2>&1 || : [ -n "$UNIMAP" ] && echo FONT_UNIMAP=$UNIMAP >> /etc/vconsole.conf 2>&1 || : [ -n "$KEYTABLE" ] && echo KEYMAP=$KEYTABLE >> /etc/vconsole.conf 2>&1 || : fi #rm -f "$SYSCONFIG_KEYBOARD" >/dev/null 2>&1 || : #rm -f "$SYSCONFIG_CONSOLEFONT" >/dev/null 2>&1 || : # Migrate HOSTNAME= from /etc/sysconfig/network SYSCONFIG_NETWORK=/etc/sysconfig/network if [ -e "$SYSCONFIG_NETWORK" -a ! -e /etc/hostname ]; then unset HOSTNAME . "$SYSCONFIG_NETWORK" >/dev/null 2>&1 || : [ -n "$HOSTNAME" ] && echo $HOSTNAME > /etc/hostname 2>&1 || : fi #sed -i '/^HOSTNAME=/d' "$SYSCONFIG_NETWORK" >/dev/null 2>&1 || : if sd_booted; then SYSTEMCTL_BIN=systemctl; SYSTEMD_HELPER=/lib/systemd/systemd-update-helper; $SYSTEMCTL_BIN daemon-reload if [ $1 -eq 1 ]; then # Initial installation $SYSTEMCTL_BIN --no-reload preset systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service systemd-oomd.service || : else # Package upgrade, not uninstall $SYSTEMD_HELPER mark-restart-system-units systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service systemd-oomd.service || : fi fi |
Pre install