From: Christian Hofstaedtler Date: Fri, 25 Nov 2011 12:06:41 +0000 (+0100) Subject: Move grml-live.log to output directory X-Git-Tag: v0.17.0~71 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=d9a34890461d7b9fc6bd380834f2426c6869ba6e Move grml-live.log to output directory --- diff --git a/grml-live b/grml-live index 351854d..6538b99 100755 --- a/grml-live +++ b/grml-live @@ -160,13 +160,6 @@ trap bailout 1 2 3 3 6 9 14 15 trap umount_all EXIT # }}} -# log file stuff {{{ -[ -n "$LOGFILE" ] || LOGFILE=/var/log/grml-live.log -touch $LOGFILE -chown root:adm $LOGFILE -chmod 664 $LOGFILE -# }}} - # some important functions {{{ # log output: @@ -260,10 +253,8 @@ copy_addon_file() { # read local (non-packaged) configuration {{{ LOCAL_CONFIG=/etc/grml/grml-live.local if [ -r "$LOCAL_CONFIG" ] ; then - log "Sourcing $LOCAL_CONFIG" . $LOCAL_CONFIG else - log "No $LOCAL_CONFIG found, not sourcing it" LOCAL_CONFIG='' fi # }}} @@ -403,6 +394,14 @@ if [ -z "$FORCE" ] ; then fi # }}} +# create log file {{{ +[ -n "$LOGFILE" ] || LOGFILE=${OUTPUT}/grml_logs/grml-live.log +mkdir -p $(dirname "${LOGFILE}") +touch $LOGFILE +chown root:adm $LOGFILE +chmod 664 $LOGFILE +# }}} + # clean/zero/remove logfiles {{{ if [ -n "$PRESERVE_LOGFILE" ] ; then @@ -439,6 +438,9 @@ fi start_seconds=$(cut -d . -f 1 /proc/uptime) log "------------------------------------------------------------------------------" log "Starting grml-live [${GRML_LIVE_VERSION}] run on $(date)" +if [ -n "$LOCAL_CONFIG" ]; then + log "Using local config file: $LOCAL_CONFIG" +fi log "Executed grml-live command line:" log "$CMDLINE"