Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: Power management kicks when it shouldn't as network is active

  1. #1

    Default Power management kicks when it shouldn't as network is active

    Hi all,

    I'm not sure whether this should go here or in the network section...

    It concerns openSUSE 12.1 (KDE 4.7.2 release 5)

    My problem is as follows : Some time ago I set up a machine on the LAN as a simple fileserver under windows. Nothing fancy, users can just access the server to read (media) files, like music or films.
    Windows is getting on my nerves and I wish to use that machine under openSuse 12.1 (KDE). So I took the boot disk with windows on it out of the server, popped in an another disk and installed openSUSE 12.1 (KDE 4.7.2 release 5) on it. I managed to set up the system as a "file server", which only means that it can be woken via WOL (Wake - on -Lan) and that users can get at certain directories (with the media files) and read the files therein.
    So far so good,and this works as expected.
    I also set up the system so that after15 mins of inactivity, it'll go to "sleep" (suspend to ram) - so when no one accesses the server, it powers down (and can be woken via WOL). This is have done, under KDE, via system config (personal settings ->power management). The problem now is that the machine powers down even when someone is accessing it via the network, for example to view a video or film. The server dishes out the film for 15 minutes - but then powers down.

    Does anybody know how and where to configure this so that the machine doesn't power down when it serves files over the network?

    TIA

    Lenwolf

  2. #2
    Join Date
    Aug 2008
    Location
    Maryland
    Posts
    208

    Default Re: Power management kicks when it shouldn't as network is active

    Found this in Google.

    https://wiki.archlinux.org/index.php/Laptop_Mode_Tools

    I have not used this myself. But it is in the repo. You may have to turn off the desktop screen save and power management, it works on keyboard and mouse activity.

    You could also create you own batch file that loops checking for activity on the network and disables power management if there is activity.

    Code:
    cat /proc/net/netstat
    ethtool -S eth0
    
    xset -dpms #turn off DPMS
    xset +dpms turn on DPMS
    You could see about getting xdotool to fake mouse/keyboard activity if the network is active.

    xdotool - fake keyboard/mouse input, window management, and more :: semicomplete.com - Jordan Sissel

    Dave W

  3. #3
    Join Date
    Aug 2008
    Location
    Maryland
    Posts
    208

    Default Re: Power management kicks when it shouldn't as network is active

    Also found this, it was for Ubuntu but you should be able to do the same thing in openSUSE.

    Stop Ubuntu shutting down when Samba is in use | Robert Beal

    Dave W

  4. #4
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,037

    Default Re: Power management kicks when it shouldn't as network is active

    On Tue, 24 Jan 2012 17:36:03 +0000, lenwolf wrote:

    > I also set up the system so that after15 mins of inactivity, it'll go to
    > "sleep" (suspend to ram) - so when no one accesses the server, it powers
    > down (and can be woken via WOL). This is have done, under KDE, via
    > system config (personal settings ->power management). The problem now is
    > that the machine powers down even when someone is accessing it via the
    > network, for example to view a video or film. The server dishes out the
    > film for 15 minutes - but then powers down.
    >
    > Does anybody know how and where to configure this so that the machine
    > doesn't power down when it serves files over the network?


    "Inactivity" is desktop inactivity, not network inactivity.

    Routers send out RIP broadcasts (for example - a routing advertisement)
    that all nodes see, so that would count as 'network activity'.

    You'd have to do some custom scripting probably to define "inactivity" as
    "no network connections to the box".

    Jim

    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  5. #5

    Default Re: Power management kicks when it shouldn't as network is active

    Hi,

    thanks all for your comments.

    @dwestf
    The "smbstatus" command in the second link looks promising. I'll have to see whether it can be used under openSUSE and whether I can find a KDE command similar to the gnome-screensaver-command used there. Thanks for your answer!


    @hendersj
    "Inactivity" is desktop inactivity, not network inactivity.

    Routers send out RIP broadcasts (for example - a routing advertisement)
    that all nodes see, so that would count as 'network activity'.

    You'd have to do some custom scripting probably to define "inactivity" as
    "no network connections to the box".
    OK, thanks, the question is what do I tell which application with my script?
    Thanks for your answer!


    Lenwolf

  6. #6
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,037

    Default Re: Power management kicks when it shouldn't as network is active

    On Tue, 24 Jan 2012 19:56:03 +0000, lenwolf wrote:

    > OK, thanks, the question is what do I tell which application with my
    > script?


    I don't understand the question....

    What the script needs to do is monitor for traffic related to the service
    you want to keep the server running for - smbstatus is likely what you'll
    want/need to use and just poll periodically.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  7. #7

    Default Re: Power management kicks when it shouldn't as network is active

    Quote Originally Posted by hendersj View Post
    I don't understand the question....

    What the script needs to do is monitor for traffic related to the service
    you want to keep the server running for - smbstatus is likely what you'll
    want/need to use and just poll periodically.
    Yes indeed, that part I have understood.
    However, once I have determined that some network activity is going on, how do I tell the KDE power management that?
    From dwestfs link, I gather that - for gnome - you can use the "gnome-screensaver-command" with the -p parameter: that "pokes" the running screensaver to simulate user activity.

    Do you know whether there is an equivalent command for the KDE power management (not just screen saver)?

    TIA

    Lenwolf

  8. #8
    Join Date
    Aug 2008
    Location
    Maryland
    Posts
    208

    Default Re: Power management kicks when it shouldn't as network is active

    You could use xdotool instead of gnome-screensaver-command to send move mouse command. This would reset screen saver timer. Also "xset s off" is supposed to turn screensaver off and "xset s on" should turn it back on.

    Code:
    SYNOPSIS
           xset [-display display]
           [-b] [b {on|off}] [b [volume [pitch [duration]]]]
           [-bc] [bc]
           [-c] [c {on|off}] [c [volume]]
           [+dpms] [-dpms]
                [dpms standby [ suspend [ off]]]      [dpms force {standby|suspend|off|on}]
           [fp=pathlist] [-fp=pathlist] [+fp=pathlist] [fp-pathlist] [fp+pathlist]
           [fp default] [fp rehash]
           [-led [integer|named indicator]] [led [integer|named indicator]]
           [led {on|off}]
           [mouse [accel_mult[/accel_div] [threshold]]] [mouse default]
           [p pixel color]
           [-r [keycode]]  [r [keycode]] [r {on|off}] [r rate delay [rate]]
           [s [length [period]]] [s {blank|noblank}] [s {expose|noexpose}] [s {on|off}] [s default] [s activate] [s reset]
    Dave W

  9. #9

    Default Re: Power management kicks when it shouldn't as network is active

    Hi,

    Thanks dwestf.

    I'll check the xdotool.

    It seems from the man page that xset deals with the screensaver only, not with the power management.

    I'll try though, and report back later. I have to sign off now.

    Thank you.

    Lenwolf

  10. #10
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,037

    Default Re: Power management kicks when it shouldn't as network is active

    On Tue, 24 Jan 2012 20:26:03 +0000, lenwolf wrote:

    > hendersj;2433667 Wrote:
    >>
    >> I don't understand the question....
    >>
    >> What the script needs to do is monitor for traffic related to the
    >> service you want to keep the server running for - smbstatus is likely
    >> what you'll want/need to use and just poll periodically.
    >>
    >>

    > Yes indeed, that part I have understood.
    > However, once I have determined that some network activity is going on,
    > how do I tell the KDE power management that?


    It would be far easier to look for the server not being used for a period
    of time and then issue the powersave command to suspend to whatever state
    you want, rather than trying to use the desktop power management system
    in a way it's not really intended to be used.

    > From dwestfs link, I gather that - for gnome - you can use the
    > "gnome-screensaver-command" with the -p parameter: that "pokes" the
    > running screensaver to simulate user activity.


    Latest versions of gnome-screensaver-command don't seem to support that
    function any more.

    > Do you know whether there is an equivalent command for the KDE power
    > management (not just screen saver)?


    I don't, but again, I'd approach the problem differently - rather than
    setting power management to shut down after 'x' inactivity in the desktop
    environment (given that it bases 'activity' on keyboard/mouse input
    only), use a cron job to check the samba state, say, every 15 minutes,
    and if you have two consecutive periods where the state is unused, invoke
    the command to suspend the machine.

    Jim




    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •