[Solved] Simple auto-suspend script?

I'm looking for a simple solution to auto-suspend (ram/disk) a system after a certain time of inactivity. I can find surprisingly little info for this for linux (or perhaps i'm not looking in the right places), while windows for instance has this built in for years already.
The idea is simple but maybe tricky in practice; if there is no user input for x seconds, no video/audio playing or continuous disk/network usage, suspend the system. Basically the system just needs to be idle for a certain amount of time.
Does anyone know or have a working script or utility for this, or is writing one myself the only solution? The simplest approach i can think of is a combination of checking user idle time (with 'w') and sysload, though it might be necessary to determine a threshold for the latter to avoid simple jobs (cron etc.) producing a 0.01 sysload and thus preventing suspend.
Any other thoughts or suggestions about this?
Last edited by litemotiv (2010-05-07 11:03:55)

Sorry for hijacking your thread but I tryed sleepd to suspend and lock my screen after a certain amount of time. So far it's working smoothly except when I am watching something with xbmc.
So I just set --load=1 in /etc/conf.d/sleepd but it still goes to suspend. And I verified with the key o in xbmc that the cpu load is higher than 1%. I also added "-N" as sometime I let my computer download stuff for me in the background.
PARAMS=("--unused=600" "--ac-unused=600" "--load=1" "-N" "--sleep-command=su lymphatik -c slock & dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0" "--battery=2" "--hibernate-command=dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate int32:0")
Last edited by lymphatik (2010-05-01 12:56:42)

Similar Messages

  • Database auto-startup script

    Hi Team,
    How can I check whether the auto startup script is scheduled for the database after the server reboot
    OS version:Linux server1 2.6.18-194.11.1.el5 #1 SMP Tue Jul 24 05:45:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
    DB version :11.2.0.2
    /etc/oratab entry is set to Y.
    But the database did not startup after the server reboot. How to verify that the auto startup script is available?

    http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php
    HTH
    Anand

  • Auto accept script error

    Any idea why ichat 5 gives me an error on the auto accept script every time I run it ? I want to leave the auto accept on permanently but its not letting me.

    Click on the App in Applications.
    Do a Get Info from the File Menu of the Finder (or the keystrokes listed)
    If you have a Core 2 Duo Processor it will offer the option so start in 32 Bit mode.
    10:50 PM Tuesday; September 22, 2009

  • [SOLVED]Cannot get panel script to load(bspwm)

    Hi all, I am new to arch linux and just started using bspwm, have used xmonad for a few months or so. I am trying to base my desktop on windelicato's config (which is incredible imo and you can see it at his github) but am having trouble using the scripts from it. In particular, I don't get the panel that I can see in  his screenshot. I will post all relevant files that I know of, tell me if I have missed some!
    ~/.xinitrc
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
    done
    unset f
    fi
    udisksvm &
    #udiskie &
    #exec openbox-session
    #/usr/bin/start-pulseaudio-x11 &
    #razercfg -r 1:3 &
    xset m 0 0 &
    #dhcpcd net1 &
    #~/.conky/loadconky.sh &
    #steam &
    #compton --config ~/.config/compton.conf -cGb &
    #(sleep 2s && tint2)
    xrandr --output DFP17 --output DFP18 --right-of DFP17 &
    #setxkbmap -option terminate:ctrl_alt_bksp &
    bash ~/.fehbg &
    #stalonetray &
    #redshiftgui &
    xsetroot -cursor_name left_ptr &
    mpd ~/.mpd/mpd.conf &
    autocutsel -fork &
    autocutsel -selection PRIMARY -fork &
    #bash ~/.xmonad/workspaces/master
    #stalonetray -i 20 -geometry 1x1+1390+0 --sticky --skip-taskbar --no-shrink &
    #exec ~/.cabal/bin/xmonad
    #sxhkd -c ~/.config/sxhkd/sxhkdrc &
    #exec bspwm
    DEFAULT_SESSION=xmonad
    case $2 in
    xmonad)
    stalonetray &
    compton --config ~/.config/compton.conf -cGb &
    exec xmonad
    openbox)
    exec openbox-session
    bspwm|*)
    sxhkd &
    [ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
    mkfifo "$PANEL_FIFO"
    exec bspwm -c /home/jordan/.config/bspwm/bspwmrc -s "$PANEL_FIFO" -p W
    esac
    ~/.config/bspwm/bspwmrc
    #! /bin/sh
    FIRST_DESK_MAIN=i
    REMAINING_DESKS_MAIN="ii iii iv v vi vii viii ix x"
    FIRST_DESK_SECONDARY=I
    REMAINING_DESKS_SECONDARY="II III IV V VI VII VIII IX X"
    #if [[ -z `xrandr | grep " connected" | grep 'VGA'` ]]; then
    # echo "No monitor connected"
    # bspc desktop Desktop01 -n $FIRST_DESK_MAIN
    # bspc monitor -a $REMAINING_DESKS_MAIN
    # bspc monitor -p 14 0 0 0
    #else
    bspc desktop Desktop01 -n $FIRST_DESK_MAIN
    bspc monitor -a $REMAINING_DESKS_MAIN
    bspc monitor -p 14 0 0 0
    bspc monitor -f next
    bspc desktop Desktop02 -n $FIRST_DESK_SECONDARY
    bspc monitor -a $REMAINING_DESKS_SECONDARY
    bspc monitor -p 0 0 0 0
    #fi
    bspc config split_ratio 0.52
    bspc config border_width 2
    bspc config window_gap 4
    bspc config borderless_monocle true
    bspc config gapless_monocle true
    bspc config focus_follows_pointer true
    bspc config auto_alternate true
    bspc config focused_border_color #646a6d
    bspc config normal_border_color #322d29
    bspc rule -a Thunar --floating
    bspc rule -a Skype --floating
    bspc rule -a Transmission --floating
    bspc rule -a feh --floating
    bspc rule -a Gimp -d Eight --floating
    panel &
    /home/jordan/.xmonad/status_bar "#d6c3b6" "#181512" "-*-nu-*-*-*-*-*-*-*-*-*-*-*-*" &
    ~/scripts/panel (added to path in ~/.profile)
    #! /bin/sh
    flavor=${1:-bar}
    bspc control --put-status
    xtitle -sf 'T%s' > "$PANEL_FIFO" &
    clock -sf 'S%a %H:%M' > "$PANEL_FIFO" &
    case "$flavor" in
    bar)
    cat "$PANEL_FIFO" | /home/jordan/scripts/panel_bar | bar
    dzen2)
    PANEL_HEIGHT=24
    FONT_FAMILY='DejaVu Sans'
    FONT_SIZE=11
    cat "$PANEL_FIFO" | panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" -fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND"
    esac
    ~/.xmonad/status_bar
    #!/bin/bash
    foreground=$1
    background=$2
    font=$3
    conky -qc /home/jordan/.xmonad/.conky_dzen | dzen2 -x '500' -w '1420' -h '14' -ta 'r' -fg $foreground -bg $background -y '0' -fn $font
    ~/scripts/panel_bar
    #! /bin/sh
    # Example panel for LemonBoy's bar
    while read -r line ; do
    case $line in
    S*)
    sys_infos="\\r\\f5${line#?}\\fr"
    T*)
    title="\\c${line#?}"
    W*)
    wm_infos=""
    IFS=':'
    set -- ${line#?}
    while [ $# -gt 0 ] ; do
    item=$1
    name=${item#?}
    case $item in
    u*)
    # urgent desktop
    wm_infos="$wm_infos\\ f3 ${name}\\fr\\br"
    [DU]*)
    # active desktop
    wm_infos="$wm_infos\\u9\\f1 ${name} \\fr\\br\\ur"
    d*)
    # inactive but occupied desktop
    wm_infos="$wm_infos\\f2 ${name} \\fr"
    E*)
    # inactive desktop
    wm_infos="$wm_infos\\f0 ${name} \\fr"
    # L*)
    # # layout
    # layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
    # wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr"
    esac
    shift
    done
    esac
    printf "%s\n" "$wm_infos $title $sys_infos"
    done
    ~/scripts/panel_dzen2
    #! /bin/sh
    # Example panel for dzen2
    font_family='sans-serif'
    font_size=11
    . panel_colors
    adaptive_centering=0
    screen_width=$(sres -W)
    NORMIFS=$IFS
    FIELDIFS=':'
    PADDING=' '
    while getopts 'af:s:' opt ; do
    case "$opt" in
    a)
    adaptive_centering=1
    f)
    font_family=$OPTARG
    s)
    font_size=$OPTARG
    esac
    done
    shift $((OPTIND - 1))
    while read -r line ; do
    case $line in
    S*)
    # system informations
    sys_infos="^fg($COLOR_STATUS_FG)^bg($COLOR_STATUS_BG)^ca(1, bspc control --toggle-visibility)${PADDING}${line#?}${PADDING}^ca()^fg()^bg()${PADDING}"
    T*)
    # focused window title
    title="^fg($COLOR_TITLE_FG)^bg($COLOR_TITLE_BG)^ca(1, bspc window -t floating)^ca(2, bspc window -t locked)^ca(3, bspc window -c)${PADDING}${line#?}${PADDING}^ca()^ca()^ca()"
    W*)
    # window manager informations
    wm_infos="$PADDING"
    IFS=$FIELDIFS
    set -- ${line#?}
    while [ $# -gt 0 ] ; do
    item=$1
    case $item in
    [DdEUu]*)
    # desktops
    name=${item#?}
    case $item in
    u*)
    # urgent (inactive) desktop
    FG=$COLOR_URGENT_FG
    BG=$COLOR_URGENT_BG
    [DU]*)
    # active desktop
    FG=$COLOR_ACTIVE_FG
    BG=$COLOR_ACTIVE_BG
    d*)
    # inactive desktop
    FG=$COLOR_INACTIVE_FG
    BG=$COLOR_INACTIVE_BG
    E*)
    # empty desktop
    FG=$COLOR_EMPTY_FG
    BG=$COLOR_EMPTY_BG
    esac
    wm_infos="${wm_infos}^fg(${FG})^bg(${BG})^ca(1, bspc desktop -f ${name})^ca(2, bspc window -d ${name})^ca(3, bspc window -d ${name} -f)${PADDING}${name}${PADDING}^ca()^ca()^ca()"
    L*)
    # layout
    layout=$(printf "%s" "${item#?}" | sed 's/^\(.\).*/\U\1/')
    wm_infos="${wm_infos}^fg()^bg()${PADDING}${PADDING}^fg($COLOR_LAYOUT_FG)^bg($COLOR_LAYOUT_BG)^ca(1, bspc desktop -l next)^ca(2, bspc desktop -B)${PADDING}$layout${PADDING}^ca()^ca()"
    esac
    shift
    done
    IFS=$NORMIFS
    esac
    set -- $(printf '%s\0%s\0%s' "$wm_infos" "$title" "$sys_infos" | sed 's/\^[a-z]\+([^)]*)//g' | xargs -0 txtw -f "$font_family" -s "$font_size")
    left_width=$1
    center_width=$2
    right_width=$3
    left_indent=0
    right_indent=$((screen_width - right_width))
    available_center=$((screen_width - (left_width + right_width)))
    if [ $available_center -lt $center_width ] ; then
    center_indent=$((left_indent + left_width))
    else
    if [ $adaptive_centering -eq 1 ] ; then
    center_indent=$((left_width + (available_center - center_width) / 2))
    else
    center_indent=$(( (screen_width - center_width) / 2 ))
    fi
    fi
    printf "%s\n" "^pa($center_indent)$title^pa($left_indent)$wm_infos^pa($right_indent)$sys_infos"
    done
    ~/.bashrc
    # ~/.bashrc
    # If not running interactively, don't do anything
    [[ $- != *i* ]] && return
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    pathdirs=(
    ~/scripts
    for dir in $pathdirs; do
    if [ -d $dir ]; then
    path+=$dir
    fi
    done
    export EDITOR="vim"
    PS1='[\u@\h \W]\$ '
    PROMPT_COMMAND='history -a'
    export LANGUAGE="en_AU:en_GB:en"
    alias n4="go-mtpfs /media/nexus"
    alias n4dc="sudo umount /media/nexus"
    Last edited by instantepiphany (2013-09-05 01:43:25)

    added that line to xinitrc, logged out and in and the bar starts now, and displays this
    The uppercase roman numerals should be on my second monitor, which is on the right(not pictured). The bar extends the whole way across both monitors, which it should, but as I said the uppercase numbers should be on the righthand monitor, and the current window title should be in the middle of each monitor(or just the one with an active/selected window, I am not sure which but I know it shouldn't be stretched across both).
    Also, if I try to run the dzen2 part of the case instance, I get
    [jordan@jordanpc-linux ~]$ panel dzen2
    /home/jordan/scripts/panel: line 6: : No such file or directory
    /home/jordan/scripts/panel: line 7: : No such file or directory
    cat: : No such file or directory
    dzen: error, cannot allocate color ''
    Making it the default within the file causes bspwm to start without a bar at all. I don't really mind whether I end up using bar or dzen2, as long as one works. I would however appreciate fixing both so I can learn why they aren't working.
    Last edited by instantepiphany (2013-09-04 14:07:45)

  • Auto suspend on idle without Gnome or KDE? [SOLVED]

    This may be a stupid question but I've never had to actually mess with this before on a system without Gnome or KDE installed (they have their own utilities which tends to make this easy) and I've spent an hour researching to no avail.
    I'm looking for a way to force the entire computer to automatically suspend to RAM after 30 minutes of no keyboard or mouse activity. I already have pm-utils and xscreensaver installed and 'pm-suspend' already works great when I call it manually but what I'm missing is a way to detect the idle and actually call 'pm-suspend' automatically.  I do have HAL and udev.  Of course it runs X too but there is no D.E. installed.  Only various Window managers.
    BTW- this is for a Desktop not a laptop if that is significant for some reason.  The reason for it is basically I want this computer to suspend (to save power) at night and other times when it's not being used.
    Thanks for any help you can give!
    Last edited by davidm (2011-02-21 01:58:18)

    Still welcoming some help after all....
    I've been attempting to use xfce4-power-manager but am having an issue where as a normal user actual power management options other than for the monitor are disabled.  It works fine as root but not as a normal user.
    User is a member of the power group.
    Have consolekit installed.
    Launching WM from .xinitrc (No Display manager such as slim) using 'exec ck-launch-session /usr/local/bin/wm'
    Anything I am missing for why this wouldn't work? 
    Trying to use the debug option:
    (xfce4-power-manager:2633): xfce4-power-manager-WARNING **: Unable to connect to session managet : Failed to connect to the session manager: SESSION_MANAGER environment variable not defined
    (xfce4-power-manager:2633): xfce4-power-manager-WARNING **: could not map keysym 1008ffa8 to keycode
    ** (xfce4-power-manager:2633): WARNING **: No outputs have backlight property
    ** (xfce4-power-manager:2633): DEBUG: executed /usr/sbin/xfpm-power-backlight-helper --get-max-brightness; retval: 1024
    ** (xfce4-power-manager:2633): DEBUG: xfpm_brightness_setup_helper: get-max-brightness returned -1
    ** (xfce4-power-manager:2633): DEBUG: no brightness controls available
    Last edited by davidm (2011-02-21 01:17:51)

  • [SOLVED] Simple Shell Scripting Question - Echo and Execute?

    I've got a bash script which has many different commands it executes in a row. Each time the script executes one of the commands, it outputs what it is doing to the screen:
    echo "cp -r home new"
    cp -r home new
    echo "mv testfile new/."
    mv testfile new/.
    I am just wondering if there is a function to execute a command and output it at the same time. Something like...
    echoandexecute("cp -r home new")
    echoandexecute("mv testfile new/.")
    Last edited by tony5429 (2008-08-27 19:59:04)

    Otherwise you can define it yourself:
    echoandexecute() {
    echo $1
    $1
    echoandexecute "cp -r home new"
    Last edited by catwell (2008-08-27 20:57:16)

  • How to solve the auto word break problem in Arabic language Flex project

    Hi, I'm using Flex SDK 3.5 to develop a game in Arabic. Now I have a problem with the auto word break on the TextArea Control.
    The output looks like this (Sorry I can't type arabic, so I use English instead)
    I don't know any A
    rabic text
    The expected outpit should be
    I don't know any
    Arabic text
    My settings of the textarea are fine in English version games. But just didn't work in Arabic. Any idea how to solve this problem? Thanks.

    Hi Rodger,
    Sorry to reopen this thread again. I was puzzled by the data format in Motion-DDK.
    From the Motion-DDK, if u32, i32 and f64 data are passed to and from the controller, a specific format must be followed as below:
    u32:
    u32 cmddata[x] = (WORD) (u32data ?16);
    cmddata[x + 1] = (u16) u32data;
    i32:
    i32 cmddata[x] = (WORD) (i32data ?16);
    cmddata[x + 1] = (i16) i32data;
    f64:
    f64—big endian order cmddata[x] = ((u16) (&f64data)) [3];
    cmddata[x + 1] = ((u16) (&f64data)) [2];
    cmddata[x + 2] = ((u16) (&f64data)) [1];
    cmddata[x + 3] = ((u16) (&f64data)) [0];
    f64—little endian order cmddata[x] = ((u16) (&f64data)) [0];
    cmddata[x + 1] = ((u16) (&f64data)) [1];
    cmddata[x + 2] = ((u16) (&f64data)) [2];
    cmddata[x + 3] = ((u16) (&f64data)) [3];
    My first question: is the "?" symbol means the >> (shift operator) or something else?
    The second question is: if "?" means ">>" in this list, all the u32 and i32 data are always transferred in big-endian order. Is it the only correct way to deliver the i32 and u32 data? Or I can pass the u32 and i32 either in little-order or big-order depending on my platform?
    The last one: could you provide a feasible C code on how to convert the f64 data to u16?
    I first followed the format in the list to convert the f64 data, but met with a lot of compiler errors in VC++. After checked with MSDN, it is said the convert process is double(f64)->long(i32)->unsigned short(u16). But the decimal part of double will be truncated during converting to long...
    So, could you help me with some very simple sample code on the convert process? 
    Thank you for your support!
    Rick
    MSP

  • System always auto-suspends when the lid is closed

    Hello,
    I am trying to prevent my laptop (a System76 Lemur Ultra 3) from suspending when the lid is closed.  No matter what I change in the configuration, the laptop always suspends when the lid is closed.  The output of journalctl is as follows after this happens:
    Feb 21 04:35:32 hostname systemd-logind[196]: Lid closed.
    Feb 21 04:35:32 hostname systemd-logind[196]: Suspending...
    Feb 21 04:35:32 hostname systemd[1]: Starting Sleep.
    Feb 21 04:35:32 hostname systemd[1]: Reached target Sleep.
    Feb 21 04:35:32 hostname systemd[1]: Starting Suspend...
    Feb 21 04:35:33 hostname systemd-sleep[2001]: Suspending system...
    Feb 21 04:35:33 hostname kernel: PM: Syncing filesystems ... done.
    Feb 21 04:35:33 hostname kernel: PM: Preparing system for mem sleep
    Feb 21 04:35:43 hostname kernel: Freezing user space processes ... (elapsed 0.06 seconds) done.
    Feb 21 04:35:43 hostname kernel: Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    Feb 21 04:35:43 hostname systemd[1]: Time has been changed
    Feb 21 04:35:43 hostname systemd[1]: systemd-tmpfiles-clean.timer: time change, recalculating next elapse.
    Feb 21 04:35:43 hostname systemd-logind[196]: Lid opened.
    Feb 21 04:35:43 hostname acpid[190]: client 1812[0:100] has disconnected
    Feb 21 04:35:43 hostname kernel: PM: Entering mem sleep
    Feb 21 04:35:43 hostname kernel: Suspending console(s) (use no_console_suspend to debug)
    Feb 21 04:35:43 hostname kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
    Feb 21 04:35:43 hostname kernel: sd 0:0:0:0: [sda] Stopping disk
    Feb 21 04:35:43 hostname kernel: PM: suspend of devices complete after 1092.547 msecs
    Feb 21 04:35:43 hostname kernel: PM: late suspend of devices complete after 0.556 msecs
    Feb 21 04:35:43 hostname kernel: jme 0000:03:00.0: wake-up capability enabled by ACPI
    Feb 21 04:35:43 hostname kernel: ehci_hcd 0000:00:1d.0: wake-up capability enabled by ACPI
    Feb 21 04:35:43 hostname kernel: ehci_hcd 0000:00:1a.0: wake-up capability enabled by ACPI
    Feb 21 04:35:43 hostname kernel: PM: noirq suspend of devices complete after 66.095 msecs
    Feb 21 04:35:43 hostname kernel: ACPI: Preparing to enter system sleep state S3
    Feb 21 04:35:43 hostname kernel: PM: Saving platform NVS memory
    Feb 21 04:35:43 hostname kernel: Disabling non-boot CPUs ...
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 1 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 2 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 3 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 4 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 5 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 6 is now offline
    Feb 21 04:35:43 hostname kernel: smpboot: CPU 7 is now offline
    Feb 21 04:35:43 hostname kernel: Extended CMOS year: 2000
    Feb 21 04:35:43 hostname kernel: ACPI: Low-level resume complete
    Feb 21 04:35:43 hostname kernel: PM: Restoring platform NVS memory
    Feb 21 04:35:43 hostname kernel: Extended CMOS year: 2000
    Feb 21 04:35:43 hostname kernel: Enabling non-boot CPUs ...
    Feb 21 04:35:43 hostname systemd-sleep[2001]: System resumed.
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
    Feb 21 04:35:43 hostname kernel: CPU1 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 2 APIC 0x4
    Feb 21 04:35:43 hostname kernel: CPU2 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 3 APIC 0x6
    Feb 21 04:35:43 hostname kernel: CPU3 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 4 APIC 0x1
    Feb 21 04:35:43 hostname kernel: CPU4 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 5 APIC 0x3
    Feb 21 04:35:43 hostname kernel: CPU5 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 6 APIC 0x5
    Feb 21 04:35:43 hostname kernel: CPU6 is up
    Feb 21 04:35:43 hostname kernel: smpboot: Booting Node 0 Processor 7 APIC 0x7
    Feb 21 04:35:43 hostname kernel: CPU7 is up
    Feb 21 04:35:43 hostname kernel: ACPI: Waking up from system sleep state S3
    Feb 21 04:35:43 hostname kernel: ehci_hcd 0000:00:1a.0: wake-up capability disabled by ACPI
    Feb 21 04:35:43 hostname kernel: ehci_hcd 0000:00:1d.0: wake-up capability disabled by ACPI
    Feb 21 04:35:43 hostname kernel: PM: noirq resume of devices complete after 133.251 msecs
    Feb 21 04:35:43 hostname kernel: PM: early resume of devices complete after 0.425 msecs
    The first thing I did was to disable systemd's acpi features by setting /etc/systemd/logind.conf as follows:
    # This file is part of systemd.
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.
    # See logind.conf(5) for details
    [Login]
    #NAutoVTs=6
    #ReserveVT=6
    #KillUserProcesses=no
    #KillOnlyUsers=
    #KillExcludeUsers=root
    #Controllers=
    #ResetControllers=cpu
    #InhibitDelayMaxSec=5
    HandlePowerKey=ignore
    HandleSuspendKey=ignore
    HandleHibernateKey=ignore
    HandleLidSwitch=ignore
    #PowerKeyIgnoreInhibited=no
    #SuspendKeyIgnoreInhibited=no
    #HibernateKeyIgnoreInhibited=no
    #LidSwitchIgnoreInhibited=yes
    IdleAction=suspend
    IdleActionSec=45min
    However, the behavior was the same as before.  I also tried setting
    LidSwitchIgnoreInhibited=no
    but after reading man 5 logind.conf it seems that this is unnecessary (and it had no effect when I tried it).
    acpid is also installed but I have commented out the contents of /etc/acpi/handler.sh as well as all the scripts in /etc/acpi/actions.  I noticed that there is also a UPower daemon which was installed as a dependency and thought that it might be triggering the suspend.  I tried setting
    IgnoreLid=true
    in /etc/UPower/UPower.conf but this also had no effect.
    systemctl list-units has the following output:
    UNIT LOAD ACTIVE SUB DESCRIPTION
    proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
    sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1b.0/sound/card0
    sys-devices-pci0000:00-0000:00:1c.2-0000:02:00.0-net-wlan0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1c.2/0000:02:00.0/net/wlan0
    sys-devices-pci0000:00-0000:00:1c.3-0000:03:00.0-net-eth0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1c.3/0000:03:00.0/net/eth0
    sys-devices-pci0000:00-0000:00:1d.0-usb2-2\x2d1-2\x2d1.2-2\x2d1.2.1-2\x2d1.2.1.1-2\x2d1.2.1.1.1-2\x2d1.2.1.1.1:1.2-sound-card1.device loaded active plugged 0819
    sys-devices-pci0000:00-0000:00:1d.0-usb2-2\x2d1-2\x2d1.2-2\x2d1.2.1-2\x2d1.2.1.3.device loaded active plugged Deskjet_5400_series
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loaded active plugged ST9500420AS
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda2.device loaded active plugged ST9500420AS
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda.device loaded active plugged ST9500420AS
    sys-devices-pci0000:00-0000:00:1f.2-ata3-host2-target2:0:0-2:0:0:0-block-sr0.device loaded active plugged TSSTcorp_CDDVDW_SN-208AB
    sys-devices-platform-serial8250-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0
    sys-devices-platform-serial8250-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1
    sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2
    sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3
    sys-module-configfs.device loaded active plugged /sys/module/configfs
    sys-subsystem-net-devices-eth0.device loaded active plugged /sys/subsystem/net/devices/eth0
    sys-subsystem-net-devices-wlan0.device loaded active plugged /sys/subsystem/net/devices/wlan0
    -.mount loaded active mounted /
    dev-hugepages.mount loaded active mounted Huge Pages File System
    dev-mqueue.mount loaded active mounted POSIX Message Queue File System
    media-usbhd\x2dsda1.mount loaded active mounted /media/usbhd-sda1
    sys-kernel-config.mount loaded active mounted Configuration File System
    sys-kernel-debug.mount loaded active mounted Debug File System
    tmp.mount loaded active mounted Temporary Directory
    cups.path loaded active waiting CUPS Printer Service Spool
    systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
    systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
    acpid.service loaded active running ACPI event daemon
    atd.service loaded active running ATD daemon
    cronie.service loaded active running Periodic Command Scheduler
    cups.service loaded active running CUPS Printing Service
    dbus.service loaded active running D-Bus System Message Bus
    [email protected] loaded active running Getty on tty1
    laptop-mode.service loaded active exited Laptop Mode Tools
    polkit.service loaded active running Authorization Manager
    postfix.service loaded active running Postfix Mail Transport Agent
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service loaded active running Login Service
    systemd-modules-load.service loaded active exited Load Kernel Modules
    systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
    systemd-sysctl.service loaded active exited Apply Kernel Variables
    systemd-tmpfiles-setup.service loaded active exited Recreate Volatile Files and Directories
    systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
    systemd-udevd.service loaded active running udev Kernel Device Manager
    systemd-user-sessions.service loaded active exited Permit User Sessions
    systemd-vconsole-setup.service loaded active exited Setup Virtual Console
    upower.service loaded active running Daemon for power management
    wicd.service loaded active running Wicd a wireless and wired network manager for Linux
    acpid.socket loaded active listening ACPID Listen Socket
    cups.socket loaded active running CUPS Printing Service Sockets
    dbus.socket loaded active running D-Bus System Message Bus Socket
    dmeventd.socket loaded active listening Device-mapper event daemon FIFOs
    lvmetad.socket loaded active listening LVM2 metadata daemon socket
    systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
    systemd-journald.socket loaded active running Journal Socket
    systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
    systemd-udevd-control.socket loaded active listening udev Control Socket
    systemd-udevd-kernel.socket loaded active running udev Kernel Socket
    basic.target loaded active active Basic System
    cryptsetup.target loaded active active Encrypted Volumes
    getty.target loaded active active Login Prompts
    graphical.target loaded active active Graphical Interface
    local-fs-pre.target loaded active active Local File Systems (Pre)
    local-fs.target loaded active active Local File Systems
    multi-user.target loaded active active Multi-User
    network.target loaded active active Network
    printer.target loaded active active Printer
    remote-fs.target loaded active active Remote File Systems
    sockets.target loaded active active Sockets
    sound.target loaded active active Sound Card
    suspend.target loaded active active Suspend
    swap.target loaded active active Swap
    sysinit.target loaded active active System Initialization
    systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
    LOAD = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB = The low-level unit activation state, values depend on unit type.
    74 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.
    Any ideas on what might be causing the system to suspend when the lid is closed would be appreciated.
    Thanks
    Last edited by Superposition (2013-02-21 15:48:06)

    qinohe wrote:You don't have to disable acpi!
    Since you made the complete switch to systemd, why not let systemd handle this kind of events?
    I was referring to the suggestion of setting acpi=off on the kernel line.  systemd can only run a few preset actions on events like lid close (e.g. suspend, poweroff, ignore, etc.).  I need to run custom scripts.  Also, for some reason I still do not fully understand, it was not working properly.  The log in my original post seems to show that it was initiating the suspend.
    qinohe wrote:
    progandy wrote:Yes, it is easier, but my laptop should react differently depending on the power source. With AC power lid-switch locks the screen, in battery mode it suspends. That is impossible with systemd.
    Yes you need something like laptop-mode-tools for that, I know systemd will not do that, for now.
    But that is not the issue here!, the issue here is that the llid-switch-button' shouldn't be used at all.
    For as far as possible I would still recommend systemd to handle your events!, but it's your decision finally!
    You need acpid for that not laptop-mode-tools.  This is exactly what apcid is for --- running user scripts on ACPI events.
    Anyway, I finally have this fixed though I still have no idea what the problem was.  I ran out of ideas on how to fix it and #archlinux didn't know either so I went the painful but sure route.  I did full reinstall and reinstalled all programs.  logind was still behaving as this point (not ignoring it's logind.conf file as it seemed to be before the reinstall) after this so I concluded that the packages installed were not the problem at least with their default configs.  After that, I gradually restored the config files I cared about while testing to see if logind still worked correctly.  Contrary, to what I expected it never broke and I was able to restore all modified configs and get correct behavior.
    I suspect there was some old out of date config file somewhere that was causing the problem but it's hard to say which one it was.  I could probably figure it out with a bit more experimentation but have already spent enough time fixing this...
    In case anyone else needs a similar configuration, the relevant files are as follows.  This sets up the system to lock whenever systemd executes a suspend action.  It also sets up acpid to suspend on lid close.
    Make sure you have installed acpid and enabled it to run at startup.
    /etc/systemd/logind.conf
    # This file is part of systemd.
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.
    # See logind.conf(5) for details
    [Login]
    /etc/systemd/logind.conf
    #NAutoVTs=6
    #ReserveVT=6
    #KillUserProcesses=no
    #KillOnlyUsers=
    #KillExcludeUsers=root
    #Controllers=
    #ResetControllers=cpu
    #InhibitDelayMaxSec=5
    HandlePowerKey=ignore
    HandleSuspendKey=ignore
    HandleHibernateKey=ignore
    HandleLidSwitch=ignore
    #PowerKeyIgnoreInhibited=no
    #SuspendKeyIgnoreInhibited=no
    #HibernateKeyIgnoreInhibited=no
    #LidSwitchIgnoreInhibited=yes
    #IdleAction=ignore
    #IdleActionSec=30min
    /etc/acpi/handler.sh
    #!/bin/bash
    # Default acpi script that takes an entry for all actions
    case "$1" in
    button/power)
    case "$2" in
    PBTN|PWRF)
    logger 'PowerButton pressed'
    /usr/bin/systemctl poweroff
    logger "ACPI action undefined: $2"
    esac
    button/sleep)
    case "$2" in
    SLPB|SBTN)
    logger 'SleepButton pressed'
    /usr/bin/systemctl suspend
    logger "ACPI action undefined: $2"
    esac
    ac_adapter)
    case "$2" in
    AC|ACAD|ADP0)
    case "$4" in
    00000000)
    logger 'AC unpluged'
    /usr/sbin/laptop_mode auto
    00000001)
    logger 'AC pluged'
    /usr/sbin/laptop_mode auto
    esac
    logger "ACPI action undefined: $2"
    esac
    battery)
    case "$2" in
    BAT0)
    case "$4" in
    00000000)
    logger 'Battery online'
    /usr/sbin/laptop_mode auto
    00000001)
    logger 'Battery offline'
    /usr/sbin/laptop_mode auto
    esac
    CPU0)
    *) logger "ACPI action undefined: $2" ;;
    esac
    button/lid)
    case "$3" in
    close)
    logger 'LID closed'
    /usr/sbin/laptop_mode auto
    if [ $(cat /sys/class/power_supply/ADP0/online) -eq 0 ]; then
    /usr/bin/systemctl suspend
    fi
    open)
    logger 'LID opened'
    /usr/sbin/laptop_mode auto
    logger "ACPI action undefined: $3"
    esac
    logger "ACPI group/action undefined: $1 / $2"
    esac
    # vim:set ts=4 sw=4 ft=sh et:
    Last edited by Superposition (2013-02-23 23:15:54)

  • I can't get a simple "do shell script" in AppleScript to work!

    Hi All,
    I can get simple commands like "do shell script "ls"" or "do shell script "ps"" to work in AppleScript, but I cannot get something like "do shell script "python -V"" to work. (yes, my shell script says: do shell script "python -V" (no double quotes!))
    This is driving me nuts!
    Can anyone help?
    - Jon

    python -V appears to direct its output to stderr. Try
    do shell script "python -V 2>&1"

  • Simple button navigation script

    This question is so simple-I can't really find the answer
    anywhere, but as a complete NooB I have no idea how to make this
    work. I have a nested movie 1 layer down from main stage that has
    several navigation buttons that move to different main stage
    labeled frames. I get an 1120 error because I am somehow not
    calling them out on the script. I have named the instances..so
    that's not the problem. I think I just need to somehow direct the
    script to the nested location. If I move the buttons to the main
    stage I get no errors and it all works perfectly. Please help.
    Here's a sample script for the button:

    ok..not to mix things up but here's the instance name of
    button I'm currently working on: "buttonbio".
    It's located in a mc called "movFilmbackground". I'm trying
    to get the playhead to go to the frame label "bio" on the main
    stage.
    If I put the first code in...on the main stage at the
    beginning of the timeline, nothing happens when I try the button...
    If I put the second code in.. I get 1120 error.."access of
    undefined property buttonbio" & 1180 error "call to possibly
    undefined method movFilmbackgound"
    CODE

  • [SOLVED for now] Suspend-to-RAM broken - immediately turns on again

    Hi everyone,
    Susped-to-RAM was working flawlessly on my lenovo IdeaPad S12 Netbook until recently:
    When I Suspend-to-RAM (via KDE) the system apparently suspends correctly but then it instantly turns back on. So the problem is not that I cannot suspend but rather that the system turns back on immediately after suspending. Usually the system could only be turned back on by pressing a button on the keyboard or the power button (not by moving the mouse or opening the laptop lid).
    I unplugged all attached devices, including mouse, keyboard, power supply and network but that doesn't help.
    I'm pretty clueless what could cause this and would be happy if someone could point me in some direction. This used to work until recently but I don't know what update broke it.
    Last edited by Vortex375 (2012-03-02 16:37:18)

    Vortex375 wrote:
    Update:
    The system stays asleep when I unload the ehci_hcd and ohci_hcd before suspending (unloading just ehci_hcd as suggested on other sites doesn't work).
    So some kind of usb device seems to trigger the wakeup. As I said before I don't have any usb devices plugged in, though.
    Since unloading the usb drivers is not very convenient I would really like to find out what exactly causes the wakeup. I don't really have a clue where to start, though.
    I use a script to unload ehci_hcd automatically when I suspend (my issue is slightly different, it doesn't immediately come back, it just doesn't finish suspending and gets stuck on a black screen)
    I'd imagine a script someone similar to this would work:
    http://thecodecentral.com/2011/01/18/fi … orking-bug
    Last edited by bwat47 (2012-03-02 01:23:23)

  • Simple date stamp script

    Hello Adobe Community!
    I have 100+ photos to which I need to add a date stamp. Is there a simple script to do this? I'd like to make it an action too if possible, and it's worth noting that I have no idea how to script! There were some samples linked here but I can't for the life of me figure out how to edit them to get the desired effect.

    You can't use the date from either the profile folder or NTUSER.DAT as a reliable indicator of when a user last logged on, if I understand what you're trying to do.  The profile folder date may not be updated even when the user's profile is active;
    my own profile folder on my current system hasn't been updated for fifty days, even though I've logged off and on repeatedly and rebooted the system at least once.
    On the other hand, NTUSER.DAT, since it contains the user's registry hive, can be updated
    at any time by a malware scanner, malicious website blocker, or registry cleaner, or (I think) by some kinds of software installation or update.
    If you want to delete user profiles according to when the user last logged on, you're probably going to have to scan the security log (assuming you have security auditing enabled).  Maybe a tool like
    Log Parser from Microsoft is what you need.
    If you're running in a domain, you should research ways to get information from Active Directory as well.

  • Auto clicker script constantly running cant close it help!!

    i tried to get auto clicker for my mac, to play minecraft and i set it on the script to click 10 times a second. now it wont let me click on the mouse or use the keyboard. i have tried turning it off and back on a few times and still nothing all i want to know is how to stop the script and let me play minecraft

    restart your computer? How did you set the script to start?

  • [Haskell]How to read in haskell and solve simple problems

    Hello,
    I'm an experienced C/C++ programmer and I would like to use Haskell to solve some problems.
    But it is hard to me to write a simple way to read input from a file and analyze it, so I ask you how to do this. I didn't find how to do this around google or this forum, that's why I came to here.
    Suppose we are given this problem:
    "We're analyzing numbers and we want to know which numbers are even. The input consists on a number, N, and then N lines which contain a single integer. You are to say what numbers are even."
    INPUT EXAMPLE:
    3
    1234
    5555555
    123044390581349287182
    OUTPUT EXAMPLE:
    yes
    no
    yes
    I wrote the module that returns a string depending on if the number is even or not... But I would like to know how to repeat that function for N numbers. I don't want a superoptimized way or a strange way, I just want a simple and readable one...
    In C++ i would do:
    for (int i = 0; i < cases; i++)
    cin >> number;
    cout << analyze(number) << endl; // analyze returns a string
    Can you iluminate with your knowledge, archers?
    Thank you.

    Well, you said that the first line has the number N, followed by N lines. Given your description the program would always test the whole file.
    If you have a file with X lines and you'd only like to test N <= X  lines, this should do it:
    module Main where
    import System.IO
    import Control.Applicative
    main = do
    let test x = if even (read x) then "yes" else "no"
    withFile "test" ReadMode $ \handle -> do
    nlines <- read <$> hGetLine handle
    content <- hGetContents handle
    mapM_ ( putStrLn . test )
    . take nlines
    . lines
    $ content

  • Auto mdx script creation

    Hi I am new to MDX and am looking for a quick way to create an MDX scriopt. I have used Visual Explorer to create a report, how do I extract the MDX script?
    The reason I need to do this is to create a custom query in OBIEE (10g) that make use of the output from this script.
    Thanks.

    Hello,
    the major disadvantage acc to me is that , there is no independent check on the excise values in the invocie, if there are any errors, or values are incorrect , then the excise invocice nad has to be recreated
    if the checks are in place in invoice stage, there should not be a issues
    also if the values are fixed , standardised then also it helps to have auto invocie creation
    hope this helps
    Thanks
    akasha

Maybe you are looking for

  • How to install Developer 6.0 Personal Oracle

    When I install personal Oracle 8 (trial)on my pc (Windows NT 4 sp4)I don't have problem and it work well. The problem is when I install developer 6.0,(in a different folder) I can't log on any applications any more. Thank for your help Patrice (Quebe

  • Aggregate device: BIG PROBLEM with mbox(digidesign)

    i must admit, meanwhile i am truly desperate... MAYBE ONE OF YOU HAS THE SAME EXPERIENCE AND HENCE A SOLUTION TO IT... problem is as follows: i have a mbox1 connected via usb to my ibook g4 1.33ghz (ppc) and want to make an aggegate device in the osx

  • Getting Dashboard Error

    Dear Sir, I used SAP Addon that is "Dashboard Packaging Wizard". When i select my own Dashboard then i getting the error like. The requested dashboard does not exist. Dashboard:/com.sap.b1.dashboards/0010000106.XXX_Top_10_BPs.DAS0001/default.html If

  • Using previous Deployment Parameter Values

    Hi I had deployed .ear application on SDM. While deploying I choosed New Parameters instead of Use Existing Deployment Parameter Values Can anybody help me, how to recover the previous parameters or is it possible to undeploy this application by reta

  • Error 1935

    Hi.  This is my first time on Adobe forums as I have never had a problem with it before.  I downloaded Reader 10.1.2 and then installation reached 96% when i received the 1935 error message.  I disabled Norton whilst downloading and did it from IE8.