Log to stdout and stderr, no longer to /var/log/postplug.log
This commit is contained in:
parent
4d6ef8a665
commit
67ba1a18c3
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# loadconf - postplug plugin: restore the QiLinux Live system/user configuration
|
# loadconf - postplug plugin: restore the QiLinux Live system/user configuration
|
||||||
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
|
# Copyright (c) 2004-2017 by Davide Madrisan <davide.madrisan@qilinux.it>
|
||||||
|
|
||||||
if [ $UID != 0 ]; then
|
if [ $UID != 0 ]; then
|
||||||
echo "$0: must be superuser." >&2
|
echo "$0: must be superuser." >&2
|
||||||
@ -28,7 +28,7 @@ while read dev mountpoint skip; do
|
|||||||
/mnt/cdrom*|swap) ;;
|
/mnt/cdrom*|swap) ;;
|
||||||
*) mount | grep "$dev" &>/dev/null
|
*) mount | grep "$dev" &>/dev/null
|
||||||
let "res = $?" # 0: mounted; 1: not mounted
|
let "res = $?" # 0: mounted; 1: not mounted
|
||||||
[ "$res" = 1 ] && mount $mountpoint 2>>$logfile
|
[ "$res" = 1 ] && mount $mountpoint >&2
|
||||||
if [ -e $mountpoint/$qiconf ]; then
|
if [ -e $mountpoint/$qiconf ]; then
|
||||||
# temporary disable bootsplash
|
# temporary disable bootsplash
|
||||||
[ -w /proc/splash ] && echo "verbose" > /proc/splash
|
[ -w /proc/splash ] && echo "verbose" > /proc/splash
|
||||||
@ -42,11 +42,11 @@ $dialog_backtitle -- "$"Restore QiLinux configuration" \
|
|||||||
""\Z4$dev\Zn ?" 8 56
|
""\Z4$dev\Zn ?" 8 56
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
/usr/sbin/livecd-restore $mountpoint >>$logfile 2>&1
|
/usr/sbin/livecd-restore $mountpoint
|
||||||
[ "$res" = 1 ] && umount $mountpoint 2>>$logfile
|
[ "$res" = 1 ] && umount $mountpoint >&2
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
[ "$res" = 1 ] && umount $mountpoint 2>>$logfile ;;
|
[ "$res" = 1 ] && umount $mountpoint >&2 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# xorg - xorg plugin for postplug
|
# xorg - xorg plugin for postplug
|
||||||
# Copyright (c) 2004-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# Copyright (c) 2004-2017 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@gmail.com>
|
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@gmail.com>
|
||||||
|
|
||||||
if [ $UID != 0 ]; then
|
if [ $UID != 0 ]; then
|
||||||
@ -389,7 +389,7 @@ if [ "$CONFCREATED" = "1" -a "$VIDEODRIVER" ]; then
|
|||||||
# sync to avoid filesystem corruption in case of system hang on probe
|
# sync to avoid filesystem corruption in case of system hang on probe
|
||||||
sync
|
sync
|
||||||
|
|
||||||
xinit /bin/true -- :5 2>>$logfile
|
xinit /bin/true -- :5
|
||||||
|
|
||||||
if [ -r /var/log/Xorg.5.log ]; then
|
if [ -r /var/log/Xorg.5.log ]; then
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# postplug - Postplug boot time configuration script
|
# postplug - Postplug boot time configuration script
|
||||||
# Copyright (c) 2004-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# Copyright (c) 2004-2017 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
|
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
|
||||||
|
|
||||||
if [ $UID != 0 ]; then
|
if [ $UID != 0 ]; then
|
||||||
@ -14,7 +14,7 @@ me="${0##*/}"
|
|||||||
[ -r /etc/postplug/postplug.defs ] ||
|
[ -r /etc/postplug/postplug.defs ] ||
|
||||||
{ currtime="`LANG=C date +\"%b %d %H:%M:%S\" 2>/dev/null`"
|
{ currtime="`LANG=C date +\"%b %d %H:%M:%S\" 2>/dev/null`"
|
||||||
echo "\
|
echo "\
|
||||||
$currtime postplug: "$"error: "$"cannot read postplug.defs" >> $logfile
|
$currtime postplug: "$"error: "$"cannot read postplug.defs" >&2
|
||||||
exit 1; }
|
exit 1; }
|
||||||
|
|
||||||
. /etc/postplug/postplug.defs
|
. /etc/postplug/postplug.defs
|
||||||
@ -28,13 +28,8 @@ export POSTPLUGON=1
|
|||||||
# set homedir if not set (needed at boot time execution)
|
# set homedir if not set (needed at boot time execution)
|
||||||
[ "$HOME" ] || export HOME=/root
|
[ "$HOME" ] || export HOME=/root
|
||||||
|
|
||||||
logfile=/var/log/postplug.log
|
|
||||||
touch $logfile
|
|
||||||
|
|
||||||
logmsg "" $"starting"" ${me}"
|
logmsg "" $"starting"" ${me}"
|
||||||
|
|
||||||
export logfile
|
|
||||||
|
|
||||||
rm -f $postplugnewdir/*
|
rm -f $postplugnewdir/*
|
||||||
|
|
||||||
# check via /proc/cmdline for plugins that must not be executed
|
# check via /proc/cmdline for plugins that must not be executed
|
||||||
|
@ -21,7 +21,7 @@ function logmsg() {
|
|||||||
local pluginame="${1:+ [$1]}"
|
local pluginame="${1:+ [$1]}"
|
||||||
local currtime="`LANG=C date +\"%b %d %H:%M:%S\" 2>/dev/null`"
|
local currtime="`LANG=C date +\"%b %d %H:%M:%S\" 2>/dev/null`"
|
||||||
|
|
||||||
if [ -w "$logfile" ]; then
|
if [ "$logfile" -a -w "$logfile" ]; then
|
||||||
echo "$currtime `hostname` postplug${pluginame}: $2" >> $logfile
|
echo "$currtime `hostname` postplug${pluginame}: $2" >> $logfile
|
||||||
else
|
else
|
||||||
echo "$currtime `hostname` postplug${pluginame}: $2"
|
echo "$currtime `hostname` postplug${pluginame}: $2"
|
||||||
|
Loading…
Reference in New Issue
Block a user