Changeset 3274 for branches/3.2


Ignore:
Timestamp:
Apr 29, 2014, 9:32:32 PM (5 years ago)
Author:
bruno
Message:
  • Improves systemd support at startup of the restore media when the system uses it (new user, groups, files included from /usr/lib/systemd, dbus,
  • Moves mindi to a bash script to try to get more debug info by redirecting into the LOGFILE. Not working yet.
  • Adds lvmetad daemon to list and launch it at restore time as new LVM version seems to need it.
  • End of renaming of mondo-restore?cfg into mondorestore.cfg
Location:
branches/3.2/mindi
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/deplist.d/lvm.conf

    r2465 r3274  
    9393/usr/sbin/lvs
    9494/usr/sbin/lvscan
     95
     96/usr/sbin/lvmetad
  • branches/3.2/mindi/deplist.d/udev.conf

    r3172 r3274  
    2323
    2424# Systemd
    25 /usr/lib/systemd/systemd-udevd
     25/etc/systemd
     26/usr/lib/systemd
     27/usr/lib/kernel
     28/usr/lib/tmpfiles.d
     29/var/lib/systemd
     30/usr/share/systemd
     31/usr/sbin/runlevel
     32/usr/sbin/udevadm
     33/usr/sbin/halt
     34/usr/bin/bootctl
     35/usr/bin/halt
     36/usr/bin/hostnamectl
     37/usr/bin/journalctl
     38/usr/bin/kernel-install
     39/usr/bin/localectl
     40/usr/bin/loginctl
     41/usr/bin/machinectl
     42/usr/bin/poweroff
     43/usr/bin/reboot
     44/usr/bin/systemd
     45/usr/bin/systemd-analyze
     46/usr/bin/systemd-ask-password
     47/usr/bin/systemd-cat
     48/usr/bin/systemd-cgls
     49/usr/bin/systemd-cgtop
     50/usr/bin/systemd-coredumpctl
     51/usr/bin/systemd-delta
     52/usr/bin/systemd-detect-virt
     53/usr/bin/systemd-inhibit
     54/usr/bin/systemd-machine-id-setup
     55/usr/bin/systemd-notify
     56/usr/bin/systemd-nspawn
     57/usr/bin/systemd-run
     58/usr/bin/systemd-stdio-bridge
     59/usr/bin/systemd-tmpfiles
     60/usr/bin/systemd-tty-ask-password-agent
     61/usr/bin/timedatectl
     62
     63# systemd needs dbus
     64/usr/bin/dbus-daemon
     65/usr/bin/dbus-launch
     66/etc/dbus-1
    2667
    2768/sbin/udevstart.static
  • branches/3.2/mindi/rootfs/etc/group

    r1733 r3274  
    1717cdrom::24:
    1818tape::26:
     19lock::54:
    1920plugdev::46:
    2021audio::81:
     
    2425fuse::106:
    2526nogroup::65534:
     27rpc:x:491:
     28rpcuser:x:490:
     29messagebus:x:499:
     30dbus:x:81:
  • branches/3.2/mindi/rootfs/etc/init.d/rcS

    r3252 r3274  
    1 #!/bin/sh
     1#!/bin/bash
    22#
    33# $Id$
     
    55# init script launched during the restore process
    66#------------------------------------------------------------
    7 
    87
    98CaughtSoftReset() {
     
    105104    openvt $opt 7 /bin/sh /sbin/wait-for-petris
    106105    openvt $opt 8 /usr/bin/tail -f $LOGFILE
    107     openvt $opt 9 /usr/bin/tail -f /var/log/messages
     106    if [ -f /var/log/messages ]; then
     107        openvt $opt 9 /usr/bin/tail -f /var/log/messages
     108    fi
    108109    # May avoid shell error messages
    109110    chmod 666 /dev/tty* /dev/console
    110111    # By default first serial line is configured as tty
    111     # Required to have a correct serial console support (MP on ia64 or VSP with iLO2 e.g.)
     112    # Required to have a correct serial console support (MP on ia64 or VSP with iLO e.g.)
    112113    for i in `cat /proc/cmdline` ; do
    113114        echo $i | grep -qi serial= && serial=`echo $i | cut -d= -f2`
    114115    done
    115116    # Doing that is only valid when using a real serial line
    116         if [[ $serial != "" && -e $serial ]]; then
     117    if [[ $serial != "" && -e $serial ]]; then
    117118        LogIt "Redirecting serial $serial to /dev/tty" 1
    118119        ln -s -f $serial /dev/tty
     
    139140    cd $GROOVY
    140141    [ "$1" != "" ] && tapedev=$1
    141     [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2`
     142    [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondorestore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2`
    142143    mt -f $tapedev rewind
    143144    if [ $? -ne 0 ]; then
     
    210211    if [ "$res" -eq "0" ] ; then
    211212        # Store the dev name in case we changed it interactively
    212         if [ -f "/tmp/mondo-restore.cfg" ]; then
    213             sed -i "s/^media-dev .*$/media-dev  $tapedev/" /tmp/mondo-restore.cfg
     213        if [ -f "/tmp/mondorestore.cfg" ]; then
     214            sed -i "s/^media-dev .*$/media-dev  $tapedev/" /tmp/mondorestore.cfg
    214215        fi
    215216    fi
     
    288289    fi
    289290    if [ "$res" -eq "0" ] ; then
    290         LogIt "OK, I am running on a CD-ROM. Good." 3
     291        LogIt "OK, I am running on a CD-ROM. Good." 1
    291292        CD_MOUNTED_OK=yes
    292293    else
    293         LogIt "You probably not have the right drivers" 3
    294         LogIt "to support the hardware on which we are running" 3
    295         LogIt "Your archives are probably fine but" 3
    296         LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 3
     294        LogIt "You probably not have the right drivers" 1
     295        LogIt "to support the hardware on which we are running" 1
     296        LogIt "Your archives are probably fine but" 1
     297        LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 1
    297298        CD_MOUNTED_OK=""
    298299    fi
     
    324325    if [ ! -e "/dev/.devfsd" ] ; then
    325326        mount -t devfs devfs /dev 2>> $LOGFILE
    326             if [ "$?" -ne "0" ] ; then
    327         LogIt "Error while trying to mount devfs"
     327        if [ "$?" -ne "0" ] ; then
     328            LogIt "Error while trying to mount devfs"
    328329        else
    329         LogIt "Devfs mounted OK"
     330            LogIt "Devfs mounted OK"
    330331        fi
    331332    fi
     
    372373
    373374RunUdevd() {
    374     # Inspiration from Mandriva 2008.0 startup script
    375     echo "Preparing udev environment..."
    376     LogIt "Preparing udev environment..."
     375    # Initial Inspiration from Mandriva 2008.0 startup script
     376    LogIt "Preparing udev environment..." 1
    377377    mv /dev /dev.static
    378378    mkdir /dev
     
    401401            /usr/bin/udevd --daemon &
    402402        elif [ -x /usr/lib/systemd/systemd-udevd ]; then
    403             /usr/lib/systemd/systemd-udevd --daemon &
     403            # from https://github.com/hut/minirc/blob/master/rc
     404            mkdir -p /run/systemd/journal
     405            /usr/lib/systemd/systemd-udevd --daemon
     406            udevadm trigger --action=add --type=subsystems
     407            udevadm trigger --action=add --type=devices
    404408        fi
    405409        echo "Waiting for udev to start..."
    406410        sleep 5
    407         LogIt "udev started manually"
     411        LogIt "udev started manually" 1
    408412    fi
    409413    mkdir -p /dev/.udev/queue/
     
    481485    fi
    482486    if [ -e "/tmp/i-want-my-lvm" ] ; then
     487        # Recent LVM need this caching daemon to work
     488        if [ -x /usr/sbin/lvmetad ]; then
     489            /usr/sbin/lvmetad
     490        fi
    483491        LogIt "Scanning LVM's..." 1
    484492        if which lvm ; then
     
    668676    local res
    669677    mount | grep /mnt/cdrom && return 0
    670     [ "`grep "backup_media_type" /tmp/mondo-restore.cfg 2> /dev/null | grep "cdstream"`" ] && return
     678    [ "`grep "backup_media_type" /tmp/mondorestore.cfg 2> /dev/null | grep "cdstream"`" ] && return
    671679    LogIt "Trying to mount CD-ROM a 2nd time..."
    672680    find-and-mount-cdrom --second-try
     
    700708        umount /tmp/tmpfs > /dev/null 2> /dev/null
    701709        rmdir /tmp/tmpfs
    702         ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondo-restore
     710        ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondorestore
    703711        LogIt "Failed to mount /tmp/tmpfs; using ugly softlink instead"
    704712    else
     
    742750
    743751    # In some cases, the OBDR tape remains in CD-ROM mode. This branch solves that issue (#498)
    744     if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] && [ -x /usr/bin/hpsa_obdr_mode ]; then
     752    if [ "`grep -i 'obdr ' /tmp/mondorestore.cfg 2>/dev/null`" ] && [ -x /usr/bin/hpsa_obdr_mode ]; then
    745753        for lun in `/usr/bin/hpsa_obdr_mode -m query /dev/cciss/* 2>&1 | grep "is an OBDR device" | cut -d' ' -f4`; do
    746754            /usr/bin/hpsa_obdr_mode -m query -l $lun /dev/cciss/* 2>&1 | grep -q "is in CD-ROM mode"
     
    852860export PATH GROOVY USER LOGFILE ARCH
    853861
    854 echo "Welcome to init (from mindi ${MINDI_VER}-r${MINDI_REV})"
    855 
    856862mount -o remount rw /
     863rm -f $LOGFILE
     864
     865# Creates log file
     866LogIt ""
     867echo "Welcome to init (from mindi ${MINDI_VER}-r${MINDI_REV})" | tee -a $LOGFILE
     868
     869mkdir /proc 2> /dev/null
     870mount /proc /proc -v -t proc  2>> $LOGFILE
     871mkdir /sys 2> /dev/null
     872mount /sys /sys -v -t sysfs 2>> $LOGFILE
     873
     874# Redirect every message to the LOGFILE
     875exec > >(tee -a ${LOGFILE})
     876exec 2> >(tee -a ${LOGFILE} >&2)
     877
    857878[ ! "$GROOVY" ] && Die "I'm not groovy!"
    858879for i in $GROOVY /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do
    859880    mkdir -p $i
    860881done
    861 #/bin/update
    862 mkdir /proc 2> /dev/null
    863 mount /proc/ /proc -v -t proc
    864 mkdir /sys 2> /dev/null
    865 mount /sys/ /sys -v -t sysfs 2>> $LOGFILE
    866882# For ESX 3
    867883[ -d /proc/vmware ] && ! grep -q /vmfs /proc/mounts && mount -t vmfs /vmfs /vmfs
    868 rm -f /foozero
    869884
    870885if [ "`grep -i denymods /proc/cmdline`" ]; then
     
    873888    export DENY_MODS=" "
    874889fi
    875 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
     890if [ "`grep -i 'obdr ' /tmp/mondorestore.cfg 2> /dev/null`" ]; then
    876891    # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-(
    877892    export DENY_MODS="usb-storage $DENY_MODS"
     
    911926LaunchTerminals
    912927
    913 # Keeping kernel silent  for module insertion
     928# Keeping kernel silent for module insertion
    914929PKLVL=`cut -f1 /proc/sys/kernel/printk`
    915930echo 0 > /proc/sys/kernel/printk
     
    922937#-------------------------------
    923938UseTmpfs
    924 if [ ! -e "/tmp/mondo-restore.cfg" ] ; then
    925     LogIt "Warning - /tmp/mondo-restore.cfg not found"
     939if [ ! -e "/tmp/mondorestore.cfg" ] ; then
     940    LogIt "Warning - /tmp/mondorestore.cfg not found"
    926941fi
    927942if [ "`grep -i pxe /proc/cmdline`" ] || [ "`grep -i net /proc/cmdline`" ]; then
     
    930945fi
    931946
    932 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg 2>/dev/null`" ]; then
     947if [ "`grep -i 'obdr ' /tmp/mondorestore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' /tmp/mondorestore.cfg 2>/dev/null`" ]; then
    933948    HandleTape
    934949    ExtractDataDisksAndLoadModules
     
    939954    ExtractDataDisksAndLoadModules
    940955    # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly)
    941     sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg
    942 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then
     956    sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondorestore.cfg
     957elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondorestore.cfg 2>/dev/null | grep media-type`" ]; then
    943958    . /sbin/start-usb
    944959
     
    10331048fdisk -l  >> $LOGFILE
    10341049LogIt "-------------"
    1035 if [ -f /tmp/mondo-restore.cfg ]; then
    1036     LogIt "/tmp/mondo-restore.cfg result:" >> $LOGFILE
     1050if [ -f /tmp/mondorestore.cfg ]; then
     1051    LogIt "/tmp/mondorestore.cfg result:" >> $LOGFILE
    10371052    LogIt "-------------"
    1038     cat /tmp/mondo-restore.cfg  >> $LOGFILE
     1053    cat /tmp/mondorestore.cfg  >> $LOGFILE
    10391054fi
    10401055
     
    10491064    ua=`UdevadmTrigger`
    10501065fi
    1051 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then
     1066if grep "backup-media-type" /tmp/mondorestore.cfg > /dev/null 2> /dev/null ; then
    10521067    LogIt "backup-media-type is specified in config file - great."
    10531068    LogIt "Calling post-init"
  • branches/3.2/mindi/rootfs/etc/passwd

    r2953 r3274  
    88daemon:x:2:2:daemon:/sbin:
    99adm:x:3:4:adm:/var/adm:
    10 man:x:13:15:man:/usr/man:
    11 guest:x:405:100:guest:/dev/null:/dev/null
    1210rpc:x:492:491:system user for rpcbind:/var/lib/rpcbind:/sbin/nologin
    1311rpcuser:x:491:490:system user for nfs-utils:/var/lib/nfs:/bin/false
    1412nobody:x:65534:100:nobody:/dev/null:
     13messagebus:x:499:499:system user for dbus:/:/sbin/nologin
     14dbus:x:81:81:system user for dbus:/:/sbin/nologin
  • branches/3.2/mindi/rootfs/etc/shadow

    r2425 r3274  
    11root:*:13956:0:99999:7:::
     2halt:*:13956:0:99999:7:::
     3operator:*:13956:0:99999:7:::
     4shutdown:*:13956:0:99999:7:::
     5sync:*:13956:0:99999:7:::
    26bin:*:13956:0:99999:7:::
     7ftp:*:13956:0:99999:7:::
    38daemon:*:13956:0:99999:7:::
    49adm:*:13956:0:99999:7:::
    5 lp:*:13956:0:99999:7:::
    6 sync:*:13956:0:99999:7:::
    7 shutdown:*:13956:0:99999:7:::
    8 halt:*:13956:0:99999:7:::
    9 mail:*:13956:0:99999:7:::
    10 news:*:13956:0:99999:7:::
    11 uucp:*:13956:0:99999:7:::
    12 operator:*:13956:0:99999:7:::
    13 games:*:13956:0:99999:7:::
     10rpc:*:13956:0:99999:7:::
     11rpcuser:*:13956:0:99999:7:::
    1412nobody:*:13956:0:99999:7:::
     13messagebus:*:13956:0:99999:7:::
     14dbus:*:13956:0:99999:7:::
Note: See TracChangeset for help on using the changeset viewer.