is shutdown known to work?

Discussion in 'Linux' started by graemev, Jun 15, 2009.

  1. graemev

    graemev

    Joined:
    Jun 15, 2009
    Messages:
    18
    Likes Received:
    0
    Original Linpus install ... 160Gb disk

    I've searched and got a number matches ... but could not see any answers.
    I've poked around in the init scripts and I can see evidence of some pretty rushed work.

    I just wanted to check is this 'well known' before I put too much effort into fixing it:

    1: The runlevel does not seem to get set ... machine comes up in runlevel 5 ... but runlevel(1) says 'unknown'
    2: shutdown does not power off (that is the GUI shutdown button) the shutdown -h command also fails to power off
    but poweroff(1) works fine. ... I can see attempts to use fasthalt (/sys/power/fasthalt) ...which does not work.
     
    graemev, Jun 15, 2009
    #1
  2. graemev

    larkim

    Joined:
    Apr 24, 2009
    Messages:
    60
    Likes Received:
    0
    GUI shutdown works (and always has done) for me. AA1 / 120gb

    Matt
     
    larkim, Jun 16, 2009
    #2
  3. graemev

    barrie

    Joined:
    Nov 11, 2008
    Messages:
    296
    Likes Received:
    0
    Location:
    UK / Switzerland
    Shutdown also works fine for me never had any problems. :)
     
    barrie, Jun 16, 2009
    #3
  4. graemev

    graemev

    Joined:
    Jun 15, 2009
    Messages:
    18
    Likes Received:
    0
    Well I created a reinstall USB stick (at great cost ...see my other post for gory details)
    used this to reinstall the AA1
    the newly installed system did popper shutdowns
    ....then I got a very slow boot (I suspect it was doing an fsck ... but the stupid blue screen hides all this)
    and when (after more reboots)it came back , shutdown no longer works.

    Looking at /sbin/shutdown , its now a script (I'm guessing /sbin/shutdown.bak is the real one) ... and it uses fasthalt, which does NOT shuwtdown the machine ....so how did this happen ? Is there some auto update in action?

    BTW ... most AA1 I see the shops juts sit at blue screen ... presumably this has hit them all ?

    Anyhow can somebody post a working /sbin/shutdown ... if it's a script ? (or the cksum if its binary)? Mine now is:

    #!/bin/sh
    if [ ! -d /home/user/.gsynaptics ]; then mkdir /home/user/.gsynaptics; fi
    synclient -l > /home/user/.gsynaptics/syn.conf
    sed -i 's/ //g' /home/user/.gsynaptics/syn.conf
    #
    rm -f /usr/bin/xfce4-session-logout
    killall ltris -15
    modprobe fastoffdrv
    #modprobe fastreboot
    /sbin/salsa -s
    #/etc/rc.d/init.d/NetworkManager stop &

    if [ "$1" = "-r" ]; then
    rm -f /.autofsck
    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    #/usr/bin/rm_driver.sh
    #/sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    exit
    fi

    /sbin/hwclock --systohc
    rm -f /.autofsck
    mount -r -v -n -o remount /

    if [ "$1" = "-r" ]; then
    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    # echo reboot > /sys/power/fastpoweroff
    fi

    if [ "$1" = "-h" ]; then
    rm_driver.sh
    sync
    sync
    echo default > /sys/power/fastpoweroff
    fi

    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
     
    graemev, Jul 6, 2009
    #4
  5. graemev

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    How are you trying to run the script? By reading it, it looks like the command should be:

    shutdown -h

    Of course, sudo is probably required because of where it is located.

    Cheers.
     
    rbil, Jul 8, 2009
    #5
  6. graemev

    larkim

    Joined:
    Apr 24, 2009
    Messages:
    60
    Likes Received:
    0
    Here's the output of cat /sbin/shutdown > shutdown.txt on my AAO 120Gb Linpus. Hope it helps!!

    Matt

    #!/bin/sh
    if [ ! -d /home/user/.gsynaptics ]; then mkdir /home/user/.gsynaptics; fi
    synclient -l > /home/user/.gsynaptics/syn.conf
    sed -i 's/ //g' /home/user/.gsynaptics/syn.conf
    #
    rm -f /usr/bin/xfce4-session-logout
    killall -9 ucview
    killall ltris -15
    modprobe fastoffdrv
    #modprobe fastreboot
    /sbin/salsa -s
    #/etc/rc.d/init.d/NetworkManager stop &

    if [ "$1" = "-r" ]; then
    rm -f /.autofsck
    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    #/usr/bin/rm_driver.sh
    #/sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    exit
    fi

    /sbin/hwclock --systohc
    rm -f /.autofsck
    mount -r -v -n -o remount /

    if [ "$1" = "-r" ]; then
    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
    # echo reboot > /sys/power/fastpoweroff
    fi

    if [ "$1" = "-h" ]; then
    rm_driver.sh
    sync
    sync
    echo default > /sys/power/fastpoweroff
    fi

    /sbin/shutdown.bak $1 $2 $3 $4 $5 $6
     
    larkim, Jul 8, 2009
    #6
  7. graemev

    larkim

    Joined:
    Apr 24, 2009
    Messages:
    60
    Likes Received:
    0
    Here's the result of (under Windows) fc shutdownml.txt shutdownother.txt (mine is ..ml.txt, yours is ..other.txt)
    Comparing files shutdownml.txt and SHUTDOWNOTHER.TXT
    ***** shutdownml.txt
    rm -f /usr/bin/xfce4-session-logout
    killall -9 ucview
    killall ltris -15
    ***** SHUTDOWNOTHER.TXT
    rm -f /usr/bin/xfce4-session-logout
    killall ltris -15
    *****

    So just that killall -9 ucview line.

    Matt
     
    larkim, Jul 9, 2009
    #7
  8. graemev

    graemev

    Joined:
    Jun 15, 2009
    Messages:
    18
    Likes Received:
    0
    Interesting. In terms of how it' s being used I guess it's shutdown -h now (it's however the GUI button kicks it od off)
    In case I was not clear (some understood ... maybe all) that script is the one I find in /sbin/shutdown (found I guess ... past tense)
    because right now I've

    mv /sbin/shutdown /sbin/shutdown.new
    mv /sbin/shutdown.bak /sbin/shutdown

    And now shutdown works (again, it used to work when I 1st re-installed)

    The killer appears to be the use of the fasthalt driver.

    The line:

    echo default > /sys/power/fastpoweroff

    is supposed to power off the machine ... on mine the power (light) says on ...the machine however is dead

    (if you want to try this by hand ... 1: need to be root, 2: make sure you sync(1) before, 3: probably need load the driver

    modprobe fastoffdrv
    sync
    sync
    sync
    echo default > /sys/power/fastpoweroff

    (3 syncs is kinda a tradition :))
     
    graemev, Jul 11, 2009
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.