• [gentoo-user] hibernate... /bin/echo: write error: No such device

    From Walter Dnes@21:1/5 to All on Thu Jul 28 00:00:01 2022
    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device

    ...with a beep, and the machine comes back. Grepping for the "echo"
    command, I get...

    [thimk][root][~] grep -r echo /etc/hibernate/
    /etc/hibernate/common.conf:# OnSuspend 20 echo "Good night!" /etc/hibernate/common.conf:# OnResume 20 echo "Good morning!"

    The latest entries in /var/log/hibernate.log are...

    Starting suspend at Wed Jul 27 05:00:47 PM EDT 2022
    hibernate: [01] Executing CheckLastResume ...
    hibernate: [01] Executing CheckRunlevel ...
    hibernate: [01] Executing LockFileGet ...
    hibernate: [01] Executing NewKernelFileCheck ...
    hibernate: [10] Executing EnsureSysfsPowerStateCapable ...
    hibernate: [11] Executing XHacksSuspendHook1 ...
    hibernate: [59] Executing RemountXFSBootRO ...
    hibernate: [89] Executing SaveKernelModprobe ...
    hibernate: [91] Executing ModulesUnloadBlacklist ...
    hibernate: [95] Executing XHacksSuspendHook2 ...
    hibernate: [98] Executing CheckRunlevel ...
    hibernate: [99] Executing DoSysfsPowerStateSuspend ...
    hibernate: Activating sysfs power state disk ...
    hibernate: [90] Executing ModulesLoad ...
    hibernate: [89] Executing RestoreKernelModprobe ...
    hibernate: [85] Executing XHacksResumeHook2 ...
    hibernate: [70] Executing ClockRestore ...
    hibernate: [59] Executing RemountXFSBootRW ...
    hibernate: [11] Executing XHacksResumeHook1 ...
    hibernate: [01] Executing NoteLastResume ...
    hibernate: [01] Executing LockFilePut ...
    Resumed at Wed Jul 27 05:00:50 PM EDT 2022


    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Adam Carter@21:1/5 to waltdnes@waltdnes.org on Thu Jul 28 01:00:01 2022
    On Thu, Jul 28, 2022 at 7:53 AM Walter Dnes <waltdnes@waltdnes.org> wrote:

    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device


    Is the device there?

    FYI,

    $ ls -l /bin/echo
    -rwxr-xr-x 1 root root 51256 May 5 11:58 /bin/echo*
    $ file /bin/echo
    /bin/echo: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
    dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
    $ qfile /bin/echo
    sys-apps/coreutils: /bin/echo

    echo is also a bash built in, but that wont be used since you're calling
    echo with the full path

    <div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 28, 2022 at 7:53 AM Walter Dnes &lt;<a href="mailto:waltdnes@waltdnes.org">waltdnes@waltdnes.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote"
    style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  One of the last few items on the laptop setup.  I emerged hibernate<br>
    and copied over the /etc/hibernate/ directory from my desktop.  When I<br>
    try to hibernate the laptop, I get...<br>

    [thimk][root][~] hibernate<br>
    /bin/echo: write error: No such device<br></blockquote><div><br></div><div>Is the device there?</div><div><br></div><div>FYI,</div><div><br></div><div>$ ls -l /bin/echo <br>-rwxr-xr-x 1 root root 51256 May  5 11:58 /bin/echo*<br></div><div>$ file /bin/
    echo <br>/bin/echo: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped</div><div>$ qfile /bin/echo <br>sys-apps/coreutils: /bin/echo</div><div><br></div><div>
     echo is also a bash built in, but that wont be used since you&#39;re calling echo with the full path<br></div></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to Adam Carter on Thu Jul 28 01:50:02 2022
    On Thu, Jul 28, 2022 at 08:57:35AM +1000, Adam Carter wrote
    On Thu, Jul 28, 2022 at 7:53 AM Walter Dnes <waltdnes@waltdnes.org> wrote:

    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device


    Is the device there?

    I get the exact same diagnostic output as you. My interpretation is
    not about the existance of "/bin/echo". I wonder if a script says
    something like...

    /bin/echo "something" > /sys/fubar

    ...and /sys/fubar is missing. The error message is not helpful.

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to Walter Dnes on Thu Jul 28 01:50:02 2022
    On Wed, 27 Jul 2022 17:53:08 -0400, Walter Dnes wrote:

    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device

    ...with a beep, and the machine comes back. Grepping for the "echo"
    command, I get...

    [thimk][root][~] grep -r echo /etc/hibernate/
    /etc/hibernate/common.conf:# OnSuspend 20 echo "Good night!" /etc/hibernate/common.conf:# OnResume 20 echo "Good morning!"

    It's not coming from the config file because that isn't using the full
    path, and these echo commands are commented out anyway.

    I suspect one the modules hibernate calls is the culprit, possible the
    last one mentioned in the logs. If the hibernate package is al scripts, I
    don't use it myself, you could grep them to see what is calling /bin/echo
    and where it is redirecting the output.

    A missing device like this could be down to a missing kernel config item,
    or a module not loaded.


    --
    Neil Bothwick

    I'm not a complete idiot - several parts are missing.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmLhzWcACgkQ92eFu0QS MJhoeA//RrE7NupB1tzwDMXFfTHAiCYJTJs7Y7spNw3c8dlM0bWw1nOpiUEk1/N1 xx3plul+nTJa3MQcJYLP7ajNIi4mGMhYBf2p0tZLdd3PPHfLP07s3ZNPKmvruvh+ ZKTiI8rPwste6KlXxNfCEko/gxeVolY+5YZ+MVDBka+zwi5XxpGy968cuvQm9/Mi nnp744rnLH5dZzslT1IZDLv1jxwXyxu/BgnvlI0/gMXw1AQlk2zIV6kSm5uEsLa3 NEP3WeDpZXLsw1IMNO3nhwXY7RutijKgmRazM2RtaBF3NvMBerV6iPxb4Hyi4+zE dD29Ot9OkzP2nw1Rum0ST4GneVz7Qv7ghCSPfZMrhzmxgFl9ysIKpKr8efZmEpQS qTiumvFwbyrdAcaVE+oRUh4wtT3etnfVeyE8qMlGB7c4S8qghlfNoULIRRm+eZxc K8hbH4cfmM+2JqCrtRnA9nVg2gH0sUo29t8QX63pISMSLXAJo/GT915Au6nZQYI5 k7pOzM7BMqAX6sCnfcvzPHuLA042oVGcWWxTfrZrzig5jhFqQkv4LDDlQl8WzTvz SQdoanFHcFm2ZmG9vSC0X2/SJp/KXztZAIpWExiC22fKUlPz3/RyEkeRdG24QZjy kGBZMdkZXxCjQXL0uSHI7L/AhiOephupczxDK2H4IXcTZvk1lG0=
    =8NL+
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. Roeleveld@21:1/5 to All on Mon Aug 1 12:10:01 2022
    On Wednesday, 27 July 2022 23:53:08 CEST Walter Dnes wrote:
    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device

    ...with a beep, and the machine comes back. Grepping for the "echo"
    command, I get...

    [thimk][root][~] grep -r echo /etc/hibernate/
    /etc/hibernate/common.conf:# OnSuspend 20 echo "Good night!" /etc/hibernate/common.conf:# OnResume 20 echo "Good morning!"

    The latest entries in /var/log/hibernate.log are...

    Starting suspend at Wed Jul 27 05:00:47 PM EDT 2022
    hibernate: [01] Executing CheckLastResume ...
    hibernate: [01] Executing CheckRunlevel ...
    hibernate: [01] Executing LockFileGet ...
    hibernate: [01] Executing NewKernelFileCheck ...
    hibernate: [10] Executing EnsureSysfsPowerStateCapable ...
    hibernate: [11] Executing XHacksSuspendHook1 ...
    hibernate: [59] Executing RemountXFSBootRO ...
    hibernate: [89] Executing SaveKernelModprobe ...
    hibernate: [91] Executing ModulesUnloadBlacklist ...
    hibernate: [95] Executing XHacksSuspendHook2 ...
    hibernate: [98] Executing CheckRunlevel ...
    hibernate: [99] Executing DoSysfsPowerStateSuspend ...
    hibernate: Activating sysfs power state disk ...
    hibernate: [90] Executing ModulesLoad ...
    hibernate: [89] Executing RestoreKernelModprobe ...
    hibernate: [85] Executing XHacksResumeHook2 ...
    hibernate: [70] Executing ClockRestore ...
    hibernate: [59] Executing RemountXFSBootRW ...
    hibernate: [11] Executing XHacksResumeHook1 ...
    hibernate: [01] Executing NoteLastResume ...
    hibernate: [01] Executing LockFilePut ...
    Resumed at Wed Jul 27 05:00:50 PM EDT 2022


    I wonder at which point it actually shows that message.
    I assume you are using:
    # eix hibernate
    * sys-power/hibernate-script
    Available versions: 2.0-r6 {vim-syntax}
    Homepage: https://gitlab.com/nigelcunningham/Hibernate-Script
    Description: Hibernate script supporting multiple suspend methods


    If yes, then try it with the verbose-option, maybe then you get to see where that is generated.

    Does suspend itself work? Or is the script failing as well?
    Do you have hibernate configured in the kernel?

    To check, you can try forcing hibernate manually by:

    # echo disk > /sys/power/state

    To resume, you will need to inform the kernel where to resume from.

    Kernel command line option: resume="/path/to/swap/device"

    If your swap-partition is a LV (eg, using LVM), you'll need to use an initrd that will find the correct device-ID to pass to the resume-functionality.

    I created my own init-ramfs for this and use the "hibernate" option provided
    by kde/plasma. I can't remember when I last used a third-party script to get this to work as it's generally quite simple to get working.

    --
    Joost

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to All on Wed Aug 3 23:40:01 2022
    Checking the obvious; "make menuconfig"...

    Power management and ACPI options
    [ ] Suspend to RAM and standby
    [*] Hibernation (aka 'suspend to disk')
    [*] Userspace snapshot device
    (/dev/sda2) Default resume partition

    Checking where/how it'll suspend...

    cat /sys/power/state
    disk

    So far, so good. I was ssh'd in and I shrank the font size to
    "unreadable" and ran "hibernate --verbosity=4", to get debug level
    output. It captured "only" the last 519 lines of output, attached as errlog.txt.gz which I copy/pasted to vim on my desktop.

    Line 305 is where "DoSysfsPowerStateSuspend" starts
    Line 317 is the "/bin/echo -n disk" statement

    Next we look at file /usr/share/hibernate/scriptlets.d/sysfs_power_state which has a short function DoSysfsPowerStateSuspend(). Anyone remember
    ye old dayes of FORTRAN, where you'd throw in print statements to debug
    errors? I've added a few debug statements, like so...

    DoSysfsPowerStateSuspend() {
    if [ -z "$SYSFS_POWER_STATE_NO_SUSPEND" ] ; then
    vecho 1 "$EXE: Activating sysfs power state $USING_SYSFS_POWER_STATE ..."
    echo "1 ==> $USING_SYSFS_POWER_STATE"
    echo "2 ==> $SYSFS_POWER_STATE_POWERDOWN_METHOD"
    echo "3 ==> $SYSFS_POWERDOWN_METHOD_FILE"
    echo "4 ==> $SYSFS_POWER_STATE_FILE"
    [ -n "$SYSFS_POWER_STATE_POWERDOWN_METHOD" ] && \
    [ -f "$SYSFS_POWERDOWN_METHOD_FILE" ] && \
    /bin/echo $SYSFS_POWER_STATE_POWERDOWN_METHOD > $SYSFS_POWERDOWN_METHOD_FILE
    /bin/echo -n $USING_SYSFS_POWER_STATE > $SYSFS_POWER_STATE_FILE
    else
    vecho 1 "$EXE: Not actually suspending (--no-suspend given)"
    fi
    return 0
    }

    The output from hibernate is...

    1 ==> disk
    2 ==>
    3 ==> /sys/power/disk
    4 ==> /sys/power/state
    /bin/echo: write error: No such device

    No powerdown method? I added "resume=/dev/sda2" to lilo.conf and
    re-ran lilo. And now we cross the boundary from the ridiculous to the
    totally utterly sublime.

    [thimk][root][~] cat /sys/power/state
    disk
    [thimk][root][~] echo disk > /sys/power/state
    -bash: echo: write error: No such device
    [thimk][root][~] cat /sys/power/state
    disk

    WTF!!!

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to Walter Dnes on Thu Aug 4 01:00:01 2022
    On 2022.08.03 17:30, Walter Dnes wrote:
    Checking the obvious; "make menuconfig"...

    Power management and ACPI options
    [ ] Suspend to RAM and standby
    [*] Hibernation (aka 'suspend to disk')
    [*] Userspace snapshot device
    (/dev/sda2) Default resume partition

    Checking where/how it'll suspend...

    cat /sys/power/state
    disk

    So far, so good. I was ssh'd in and I shrank the font size to
    "unreadable" and ran "hibernate --verbosity=4", to get debug level
    output. It captured "only" the last 519 lines of output, attached as errlog.txt.gz which I copy/pasted to vim on my desktop.

    Line 305 is where "DoSysfsPowerStateSuspend" starts
    Line 317 is the "/bin/echo -n disk" statement

    Next we look at file
    /usr/share/hibernate/scriptlets.d/sysfs_power_state
    which has a short function DoSysfsPowerStateSuspend(). Anyone
    remember
    ye old dayes of FORTRAN, where you'd throw in print statements to
    debug
    errors? I've added a few debug statements, like so...

    DoSysfsPowerStateSuspend() {
    if [ -z "$SYSFS_POWER_STATE_NO_SUSPEND" ] ; then
    vecho 1 "$EXE: Activating sysfs power state $USING_SYSFS_POWER_STATE ..."
    echo "1 ==> $USING_SYSFS_POWER_STATE"
    echo "2 ==> $SYSFS_POWER_STATE_POWERDOWN_METHOD"
    echo "3 ==> $SYSFS_POWERDOWN_METHOD_FILE"
    echo "4 ==> $SYSFS_POWER_STATE_FILE"
    [ -n "$SYSFS_POWER_STATE_POWERDOWN_METHOD" ] && \
    [ -f "$SYSFS_POWERDOWN_METHOD_FILE" ] && \
    /bin/echo $SYSFS_POWER_STATE_POWERDOWN_METHOD > $SYSFS_POWERDOWN_METHOD_FILE
    /bin/echo -n $USING_SYSFS_POWER_STATE >
    $SYSFS_POWER_STATE_FILE
    else
    vecho 1 "$EXE: Not actually suspending (--no-suspend given)"
    fi
    return 0
    }

    The output from hibernate is...

    1 ==> disk
    2 ==>
    3 ==> /sys/power/disk
    4 ==> /sys/power/state
    /bin/echo: write error: No such device

    No powerdown method? I added "resume=/dev/sda2" to lilo.conf and
    re-ran lilo. And now we cross the boundary from the ridiculous to the totally utterly sublime.

    [thimk][root][~] cat /sys/power/state
    disk
    [thimk][root][~] echo disk > /sys/power/state
    -bash: echo: write error: No such device
    [thimk][root][~] cat /sys/power/state
    disk

    WTF!!!

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications
    No answers, but some thoughts. Remember the files in /sys/power are
    not real files, they are created by sysfs (or something relying on
    sysfs.) I wonder if something in the sysfstools package will let you
    dig into why /sys seems or claims not to be there. The other
    possibility is that whatever actual program is trying to do that write
    has a bug and is recognizing some other condition as a "no such device" error, but I suppose your last test disproves that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to Walter Dnes on Thu Aug 4 01:20:02 2022
    On Wed, 3 Aug 2022 17:30:54 -0400, Walter Dnes wrote:

    Next we look at file
    /usr/share/hibernate/scriptlets.d/sysfs_power_state which has a short function DoSysfsPowerStateSuspend(). Anyone remember ye old dayes of FORTRAN, where you'd throw in print statements to debug errors? I've
    added a few debug statements, like so...

    DoSysfsPowerStateSuspend() {
    if [ -z "$SYSFS_POWER_STATE_NO_SUSPEND" ] ; then
    vecho 1 "$EXE: Activating sysfs power state
    $USING_SYSFS_POWER_STATE ..." echo "1 ==> $USING_SYSFS_POWER_STATE"
    echo "2 ==> $SYSFS_POWER_STATE_POWERDOWN_METHOD"
    echo "3 ==> $SYSFS_POWERDOWN_METHOD_FILE"
    echo "4 ==> $SYSFS_POWER_STATE_FILE"
    [ -n "$SYSFS_POWER_STATE_POWERDOWN_METHOD" ] && \
    [ -f "$SYSFS_POWERDOWN_METHOD_FILE" ] && \
    /bin/echo $SYSFS_POWER_STATE_POWERDOWN_METHOD > $SYSFS_POWERDOWN_METHOD_FILE /bin/echo -n $USING_SYSFS_POWER_STATE > $SYSFS_POWER_STATE_FILE else
    vecho 1 "$EXE: Not actually suspending (--no-suspend given)"
    fi
    return 0
    }

    The output from hibernate is...

    1 ==> disk
    2 ==>
    3 ==> /sys/power/disk
    4 ==> /sys/power/state
    /bin/echo: write error: No such device

    Which call to /bin/echo is failing? Instead of filling the script with
    echo statements, add "set -x" near the top, then it will output each line before executing it. That way you will not only see which echo call has
    failed, but you will also see the values of the environments variables in
    the call.


    --
    Neil Bothwick

    Nothing is foolproof to a sufficiently talented fool.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmLrAe8ACgkQ92eFu0QS MJhTwBAAk0vr5NdiP0fD6zTcpB5gogFnJa3HtHMVReXOew6S014vhnfqb1+PFplB fAdstS41yDI1FRnITbEtRPOZCcXDNwcBYlzHIxkPbgrp1Bkqk/KGxDKfdO0pFzjT TyPj4X3GahcQ0Z3OXtEPN3njSNqXIP0sG+RN7Rv+0QwpcRnNBcRS2D5EP6Z+Pvq8 YAFNoYwpbNI1ngOIIDu7Iv+sMJHDLJgUt6b8SI2YQYcIU3XdLXhKUfsFfk2csroz ga4/LrEpeZXMHURezRkgnDV34wXKXnTx40P7v+zAO1PEiSZJNUYHmd6SXzFOG6x0 J2B49qvMT0w2j2WNBxAQBcjL/B3TsJmHw0YbKIsYH1shAcsO01edh1JymlMP1I4D CT7wpIsRi2LQub9kr9Ay1XZQeVkMWfQKb7cE34ce8WryWeBMbnMFEYulexOY08OS xKDUzXgXhOxLYW7RF7wrdzchVJ7fDtIgOxioGemMthP08PPVNkNaGSlpxoCNKDgr /sjP4zCuaCpGC2oolQeE3o89RtNWo1+ADeGx4HKCzmz70kcBVTM2rv47RzUbEIz+ ohbamFN24x9j96kFcubVE/4VfTSEChn4iVvEehgktXuFK8iURtdGht5Z4goZ7hcK tGK41WK+qgf9I/8E5+MbKO0NWUUU77Ny+4n72eT2Oowu4hwyD9s=
    =/w4x
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to Walter Dnes on Wed Oct 12 05:20:01 2022
    On Wed, Jul 27, 2022 at 05:53:08PM -0400, Walter Dnes wrote
    One of the last few items on the laptop setup. I emerged hibernate
    and copied over the /etc/hibernate/ directory from my desktop. When I
    try to hibernate the laptop, I get...

    [thimk][root][~] hibernate
    /bin/echo: write error: No such device

    ...with a beep, and the machine comes back.

    PEBKAC++. Multiple facepalm. I outdid myself here. I got lazy on
    the laptop install by copying config files from another machine... and
    it came back to bite me. Here was my /etc/fstab ...

    /dev/sda1 /boot vfat defaults,noatime 1 2 /dev/sda2 / ext3 noatime,nodiratime,async,user_xattr 0 1 /dev/sda3 none swap sw 0 0

    ...but, but, but... this is a used Lenovo laptop, too old for UEFI, with
    only 75 gigs of disk and I've only got two partitions on it. I
    corrected fstab to the proper...

    /dev/sda1 / ext3 noatime,nodiratime,async,user_xattr 0 1 /dev/sda2 none swap sw 0 0

    I'm surprised that LILO booted at all with the bad fstab. There were
    only some error message lines that scrolled by really fast at bootup.
    Otherwise a perfectly normal bootup. I finally got around to stopping
    the laptop in mid-bootup tonight, and looking at the error message.
    Something about fsck.ext3 not finding a magic superblock on /dev/sda2.
    This prompted me to dig through the system and find the problem.

    And, oh yeah, hibernate now works with one quirk. I assume hibernate
    was reading the swap partition name from /etc/fstab for hibernation. Of
    course it got "write error: No such device" when trying to save to a non-existant swap partition /dev/sda3. The one quirk is that bootup
    comes from the first menu item in LILO, unless I manually over-ride. I
    can parse the boot image name from /proc/cmdline and feed it into "lilo -R". Then I'll have to insert it into the hibernate shutdown scripts.

    --
    I've seen things, you people wouldn't believe; Gopher, Netscape with
    frames, the first Browser Wars. Searching for pages with AltaVista,
    pop-up windows self-replicating, trying to uninstall RealPlayer. All
    those moments, will be lost in time like tears in rain... time to die.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)