Sophie

Sophie

distrib > Mageia > 8 > i586 > media > core-updates > by-pkgid > 70b57ce68165c7ce23816f11907d0015 > scriptlet

systemd-246.10-1.mga8.i586.rpm

PREIN

/bin/sh
# (cg) Cannot use rpm-helper scripts as it results in a cyclical dep as
# rpm-helper requires systemd-units which in turn requires systemd...
getent group systemd-journal &>/dev/null || groupadd -r -g 190 systemd-journal 2>&1 || :
getent group systemd-coredump &>/dev/null || groupadd -r systemd-coredump 2>&1 || :
getent passwd systemd-coredump &>/dev/null || useradd -r -l -g systemd-coredump -d / -s /sbin/nologin -c "systemd Core Dumper" systemd-coredump &>/dev/null || :
getent group systemd-network &>/dev/null || groupadd -r -g 192 systemd-network 2>&1 || :
getent passwd systemd-network &>/dev/null || useradd -r -u 192 -l -g systemd-network -d / -s /sbin/nologin -c "systemd Network Management" systemd-network &>/dev/null || :
getent group systemd-resolve &>/dev/null || groupadd -r -g 193 systemd-resolve 2>&1 || :
getent passwd systemd-resolve &>/dev/null || useradd -r -u 193 -l -g systemd-resolve -d / -s /sbin/nologin -c "systemd Resolver" systemd-resolve &>/dev/null || :


# Write on first install or upgrade from MGA3.
if [ ! -r /usr/lib/sysctl.d/50-default.conf ]; then
  if [ ! -d /etc/sysctl.d ]; then
    mkdir -m 0755 /etc/sysctl.d
  fi
  cat > /etc/sysctl.d/51-alt-sysrq.conf << EOF
# This file ensures that the Alt+SysRq Magic keys still work.
# This setting is insecure, although commonly expected and you can remove this
# file to disable this feature. It will not be readded on future systemd
# upgrades/updates.
# http://en.wikipedia.org/wiki/Magic_SysRq_key#Security
kernel.sysrq = 1
EOF

fi

PREUN

/bin/sh
if [ $1 -eq 0 ] ; then
        /usr/bin/systemctl --quiet disable \
                getty@.service \
                remote-fs.target \
                2>&1 || :

        /usr/bin/rm -f /etc/systemd/system/default.target 2>&1 || :
fi

POSTIN

/bin/sh
/usr/bin/systemd-machine-id-setup > /dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :

if [ $1 -eq 1 ] ; then
        # Try to read default runlevel from the old inittab if it exists
        runlevel=$(/usr/bin/awk -F ':' '$3 == "initdefault" && $1 !~ "^#" { print $2 }' /etc/inittab 2> /dev/null)
        if [ -z "$runlevel" ] ; then
                target="/usr/lib/systemd/system/multi-user.target"
        else
                target="/usr/lib/systemd/system/runlevel$runlevel.target"
        fi

        # And symlink what we found to the new-style default.target
        /usr/bin/ln -sf "$target" /etc/systemd/system/default.target || :

        # Flag to %posttrans
        touch /etc/systemd/.installing-units
fi

# (martinw) Run as posttrans as there was a circular dependency between systemd
# and systemd-units (mga#22620).

POSTUN

/bin/sh
if [ $1 -ge 1 ] ; then
        /usr/bin/systemctl daemon-reload 2>&1 || :
fi

# automatic systemd daemon reload on rpm installs/removals

POSTTRANS

/bin/sh
if [ -f  /etc/systemd/.installing-units ] ; then
        rm -f /etc/systemd/.installing-units

        # Enable the services we install by default.
        /usr/bin/systemctl --quiet preset \
                remote-fs.target \
                getty@.service \
                serial-getty@.service \
                console-getty.service \
                debug-shell.service \
                systemd-timesyncd.service \
                systemd-networkd.service \
                systemd-networkd-wait-online.service \
                systemd-resolved.service \
                || :
fi

hostname_new=`cat /etc/hostname 2>/dev/null`
if [ -z $hostname_new ]; then
        hostname_old=`cat /etc/sysconfig/network 2>/dev/null | grep HOSTNAME | cut -d "=" -f2`
        if [ ! -z $hostname_old ]; then
                echo $hostname_old >> /etc/hostname
        else
                echo "localhost" >> /etc/hostname
        fi
fi

Triggers

glibc

/bin/sh
# reexec daemon on self or glibc update to avoid busy / on shutdown
# trigger is executed on both self and target install so no need to have
# extra own post
if [ $1 -ge 2 -o $2 -ge 2 ] ; then
	/usr/bin/systemctl daemon-reexec 2>&1 || :
fi

systemd-units <= 245.4-4.mga8

/bin/sh
# fix the damage done by the obsoleted systemd-units's preun scriptlet:
/bin/systemctl enable \
        getty@.service \
        remote-fs.target