WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Logout and turn Xvesa and the display off  (Read 6095 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Logout and turn Xvesa and the display off
« on: May 29, 2009, 09:46:06 AM »
With vbetool a nice little "goodbye" script can be used to turn off Xvesa, turn off the display and logout all the way to the login prompt. Saves power and memory for Tinycore systems performing duties without users present.

Code: [Select]
#!/bin/sh
sudo killall Xvesa
sleep 2
sudo vbetool dpms off
sudo pkill -KILL -u tc

edit: added pkill to logout - this requires procps.tce
« Last Edit: May 31, 2009, 01:41:14 PM by bigpcman »
big pc man

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Logout and turn Xvesa and the display off
« Reply #1 on: July 15, 2011, 06:34:48 AM »
hi bigpcman: I like your post. Thank you. What I would liek to do is have one /tce folder on hda1 on a frugal install and use grub (old) to boot into various desktops. F.i: in VESA, XORG and into XFCE4.8 or other desktops.
Could you please give me some hints on how to do that.

Thank you so much
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Logout and turn Xvesa and the display off
« Reply #2 on: July 15, 2011, 10:57:40 AM »
Quote
What I would liek to do is have one /tce folder on hda1 on a frugal install and use grub (old) to boot into various desktops. F.i: in VESA, XORG and into XFCE4.8 or other desktops.
Could you please give me some hints on how to do that.

I boot from a USB stick with a single frugal tc (mc, actually) install and a single tce directory  but it boots  differently depending upon what physical host I plug it into.
 
*) loads a limited number of extensions on boot
*) compares the UUIDs of the any available filesystems a table to determine the physical host
*) loads various additional extensions and otherwise configures the system based upon the result
 
Most of the work happens in scripts called from bootsync.sh and/or bootlocal.sh
 
There's no reason the configuration couldn't be determined by some other means - perhaps a boot code that you include in various grub entries (or that you could add  manually at boot time).  You can make up your own boot codes and read them from your own scripts - the "official" boot codes are simply the ones considered by tc base (or by the kernal).

bootsync.sh
Code: [Select]
TCE_DIR=`cat /opt/.tce_dir`
TCE_DEV=`/usr/bin/dirname ${TCE_DIR}`
LEMCFG=/opt/whathost

# log to persistent storage in case this blows up on me
[ -d "${TCE_DEV}/tmp/" ] || mkdir "${TCE_DEV}/tmp/"
echo "`/bin/date +%C%y%m%d_%H%M%S` ${0} Script entry point      "                      >${TCE_DEV}/tmp/bootlog
chown tc:staff ${TCE_DEV}/tmp/bootlog

# many log messages removed below for code clarity -Lee

WHATHOST=`/opt/bin/whathost`
HOSTCFG=${LEMCFG}/${WHATHOST}

/bin/hostname ${WHATHOST}

export TCE_DIR
export TCE_DEV
export LEMCFG
export WHATHOST
export HOSTCFG

if [ -d "${HOSTCFG}" ] ; then {
  #  * * * process host-specific onboot.lst * * *
  if [ -f ${HOSTCFG}/onboot.lst ] ; then {
    cat  ${HOSTCFG}/onboot.lst | while read EXT ; do {
      su -c "tce-load -i ${EXT}" tc
    } done
  } else {
    echo "`/bin/date +%C%y%m%d_%H%M%S` ${0}   ${HOSTCFG}/onboot.lst not found"          >>${TCE_DEV}/tmp/bootlog
  } fi
  #  * * * process host-specific ondemand.lst * * *
  /opt/bin/ondemand.lem

  # * * * Process host-specific bootsync.sh * * *
  if [ -f ${HOSTCFG}/bootsync.sh ] ; then {
    ${HOSTCFG}/bootsync.sh
  } else {
    echo "`/bin/date +%C%y%m%d_%H%M%S` ${0}   ${HOSTCFG}/bootsync.sh not found"         >>${TCE_DEV}/tmp/bootlog
  } fi
} else {
  echo "`/bin/date +%C%y%m%d_%H%M%S` ${0} ${HOSTCFG} directory does not exist"          >>${TCE_DEV}/tmp/bootlog
} fi

# lem - my bootlocal.sh is set up to also do host-specific asynchronous setup
if [ -f /opt/bootlocal.sh ] ; then {
  /opt/bootlocal.sh &
} else {
  echo "`/bin/date +%C%y%m%d_%H%M%S` ${0} /opt/bootlocal.sh not found"                >>${TCE_DEV}/tmp/bootlog
} fi
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar