Page 5 of 5 FirstFirst ... 345
Results 41 to 50 of 50

Thread: Server auto-suspend?

  1. #41
    Join Date
    Apr 2010
    Beans
    3

    Re: Server auto-suspend?

    Quote Originally Posted by rodgull View Post
    Also, powernap uses the command
    Code:
    ps -eo args
    as the list to compare against the MONITORED_PROCESSES config list.

    Hence running that command on your system will show how the processes appear to powernap.

    Enjoy,
    Rod
    Hi Rod,
    thanks for the information. I have seen this patch too and added it to powernap. I didn't work for me. But I did it by editing the files and not automatically applying the patch (and I used the latest version of powernap. The patch was made for another rev, but I haven't seen any major changes).

    Anyway, there seems to be a solution, so I'll wait .

    Cheers
    wanky
    Last edited by wanky; April 23rd, 2010 at 02:29 PM.

  2. #42
    Join Date
    Feb 2008
    Beans
    4

    Re: Server auto-suspend?

    I tried also powernap_1.10-0ubuntu1 for maverik, same problem.
    Any solutions?

    Gruß
    Parti

  3. #43
    Join Date
    Dec 2007
    Location
    Newcastle-upon-Tyne - UK
    Beans
    109
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Server auto-suspend?

    I still use this for my NAS but it's a shame it doesn't quite manage what it promises! The documentation seems to be scarce too. It does work monitoring ssh, as I've set mine up to shut down the NAS 15 minutes after ssh logout.

  4. #44
    Join Date
    Jun 2006
    Beans
    36

    Re: Server auto-suspend?

    confirmed it doesn't work on oneric. auto-suspend and wakeup = the great achillis heel of linux servers at least for home use.

  5. #45
    Join Date
    Jan 2012
    Beans
    1

    Powernap doesn't detect disk activities

    Hi,

    I am pretty new to Ubuntu world! I am a mechanical engineer and trying to setup a NAS to share video and music file in my home. I setup the Ubuntu 11.10 on one of my old computers and get Samba server setup. I have 2 disks in my computer. Sda is the system where hosts Ubuntu and sdb is the one has all the video and audio files.

    Now I am thinking to save energy. Since I don't want the server to run all the time. My strategy is when I need the server , I will use WOL to wake it up. But if the server detects there is activities of the disks for more than 10 minutes. It will power off.

    So far the WOL part is working. But the power off part only partially works. The system turn if off no matter what I am doing. Even when I am accessing a large video file for the server, it is still power off. So it seems the Disk monitor function is not working at all.

    I am wondering is anyone here has the similar problem and would like to share the experience.

    Thanks

  6. #46
    Join Date
    Jan 2013
    Beans
    1

    Re: Server auto-suspend?

    Hello guys,

    This is an old thread, but it seems I can share some useful information on powernap.
    I use this utility on my NAS to shut it down when it is not used.

    Not used means (in my opinion) no network access to samba shares/no active sabnzbd/no usage of squeezebox. I also monitor if xbmc is running.

    The network related processes need to be configured in de the powernap config file(/etc/powernap/config. I have added my configuration file at the bottom of this post.

    What is does is the following:
    Check if network activity is detected for the following programs:
    - proftpd
    - squeezebox
    - samba shares
    - sabnzbdplus

    You have to configure these processes in the configuration section [IOMonitor] not [ProcessMonitor]. This last option will check if processes are started, and samba shares are always running/sleeping but present. You want to put them under IOMonitor to check if the processes really pass data over the network


    • After 15 minutes of inactivity it will perform a powersave action.
    • After 1 hour it will perform the action defined in the file /etc/powernap/action. In my case a shutdown.
    • Go to powersave

    In will check for activity every 60 seconds. Note if you're monitoring processes (using ProcessMonitor, you may want to decrease this value. Otherwise it is possible that powernap will miss the process.

    The following configuration file worked with ubuntu 11.10. Now i'm using it with 12.10. For some reason samba is reporting network usage, when it's not used. I adjusted the python script to work around this.

    Here is my configuration:
    [powernap]
    # This is the configuration file for PowerNap.
    # See powernap(1) for more information.

    # This file is Python syntax, and will be sourced by the powernap daemon
    # on start. To enact changes to this configuration, restart the daemon.
    # Example:
    # sudo service powernap restart

    # The ACTION_METHOD variable determines what action to take.
    # The possible actions are:
    # 0 - powersave
    # 1 - suspend
    # 2 - hibernate
    # 3 - poweroff
    # 4 - best-effort
    # The default mode of operation is powersave. This method will use the
    # "pm-powersave" command and will execute hooks locate in "/etc/pm/power.d" and
    # "/usr/lib/pm-utils/power.d".
    # The best-effort method, witll first, it will try a user-defined script
    # at "/etc/powernap/action", or suspend, hibernate, poweroff.
    ACTION_METHOD = 0

    # Number of seconds that all monitors must have no activity or must be absent.
    # The default is an absence period of 30 seconds.
    # Example:
    # ABSENT_SECONDS = 30
    ABSENT_SECONDS = 900

    # Grace period, after (ABSENT_SECONDS - GRACE_SECONDS) have elapsed with all of
    # the Monitors with absent activity, the system will send a Wall message for an
    # administrator to warn that the system will perform the "/usr/sbin/powernap"
    # action in GRACE_SECONDS.
    # The default grace period is 6 seconds.
    # Example:
    # GRACE_SECONDS = 6
    GRACE_SECONDS = 6

    # The powernap daemon will wake every INTERVAL_SECONDS and check for activity
    # to all of the monitors. Lower values of INTERVAL_SECONDS will provide
    # more detailed process monitoring but will consume more system resources.
    # Higher values of INTERVAL_SECONDS will consume less system resources, but
    # might miss activity that execute for less than INTERVAL_SECONDS.
    # The minimum runtime of any monitor should not be less than INTERVAL_SECONDS.
    # The default interval is 1 second.
    # Example:
    # INTERVAL_SECONDS = 1
    INTERVAL_SECONDS = 60

    # The powernap daemon will issue a warning message to the console whenever it
    # has entered into GRACE period. This warning message will warn the user that
    # it is about to perform an ACTION.
    # This warning message is done using the "wall" command, notifying all the
    # users connected to a console.
    # The default is set to 'yes' to WARN the user. It can be disabled by setting
    # the option to 'n' or 'no', or can simply be commented.
    # Example
    # WARN = y
    # WARN = n
    WARN = y

    # The powernap daemon logs errors to /var/log/powernap.err, and some basic
    # information to /var/log/powernap.log. To change the verbosity of this
    # logging, set DEBUG to 0, 1, 2, or 3:
    # The default debug level is 0.
    # DEBUG = 1
    # DEBUG = 2
    DEBUG = 0

    # The powernap daemon can watch for changes in the configuration file in
    # /etc/powernap directory without having to restart it.
    # The default value is n.
    # WATCH_CONFIG = y
    # WATCH_CONFIG = n
    WATCH_CONFIG = n

    # Kernel Modules that are to be disabled when running PowerNap on Powersave
    # mode
    #KERN_MODULES = btusb sco tfcomm bnep

    # Network Services that are to be disabled when running PowerNap on
    # PowerSave mode
    #SERVICES = postgresql-8.4 apache2 ntp network-manager

    ################################################## ##########################
    #### STAGE2 ACTION ####
    ################################################## ##########################
    [powernap-stage2]
    # Number of seconds that all monitors must have no activity or must be absent
    # while running in PowerSave mode to perform the STAGE2_ACTION_METHOD.
    # The default value is to be disabled by default. If you wish to enable the
    # Second Stage Action method, set the STAGE2_ABSENT_SECONDS and ensure that
    # STAGE2_ACTION_METHOD is set correctly.
    # Example:
    # STAGE2_ABSENT_SECONDS = 500
    STAGE2_ABSENT_SECONDS = 3600

    # The STAGE2_ACTION_METHOD variable determines what action should be taken
    # after a period on inactivity while under PowerSave Mode (See ACTION_METHOD
    # above).
    # The possible actions are:
    # 1 - suspend
    # 2 - hibernate
    # 3 - poweroff
    # 4 - best-effort
    # The default mode of operation is best-effort. This method will try to
    # user-defined script at "/etc/powernap/action", or suspend, hibernate,
    # or poweroff the machine.
    STAGE2_ACTION_METHOD = 4

    ################################################## ##########################
    #### MONITORS ####
    ################################################## ##########################

    # The [WoLMonitor] section lists all ports on which the WoL Monitor will be
    # listening for WoL Packets for any of the network interfaces.
    # Once a WoL Packet is received, the WoLMonitor will compare the data received
    # with all the network interfaces (eth's) to determine wether it is destined
    # for any of the network interfaces.
    # The default is to monitor ports 7 and 9 for WoL data packets. It can also be
    # set to any other port on which the machine is receiving WoL packets
    # Example:
    # wol1052 = 1052
    [WoLMonitor]
    wol7 = 7
    wol9 = 9

    # The [ConsoleMonitor] section enables or disables monitoring of activity
    # in the Console (tty), also tracking activity from any locally connected
    # mouse and keyboard (PS2 Only).
    # The default is enabled, set to 'y'. It can be disabled by setting it to 'n'.
    # Examples:
    # console = y
    # console = n
    [ConsoleMonitor]
    ptmx = y

    # The [ProcessMonitor] section lists all the processes to Monitor by using
    # regular expressions.
    # Each item listed will be compared against the output of "ps -eo args".
    # The default is to monitor /sbin/init, which should always be running.
    # Examples:
    # mplayer = "mplayer "
    # sshd = "sshd: .*\[priv\]$"
    # kvm = "kvm "
    [ProcessMonitor]
    #init = "^/sbin/init"
    xbmc = "^/usr/lib/xbmc/xbmc.bin"

    # The [LoadMonitor] section defines the load threshold. When the system load
    # according to /proc/loadavg is above this value, then system will be deemed
    # 'active' and will not powernap. If the system is already powernapping, then
    # the system will awake out of the powernap mode if the load raises above the
    # threshold.
    # If the threshold is set to "n" (which is default), threshold is automatically
    # calculated to be the number of online processors, as determined by:
    # getconf _NPROCESSORS_ONLN
    # Example:
    # threshold = 1.5
    # threshold = 9999
    # threshold = 0
    # threshold = n
    [LoadMonitor]
    threshold = n

    # The [TCPMonitor] section lists all the TCP ports on which to watch for
    # established connections using netstat(8). It supports both, single TCP
    # as well as port ranges.
    # There is no default TCP Monitor.
    # Examples:
    # ssh = 22
    # http = 80
    # https = 443
    # other = 64500-65000
    [TCPMonitor]
    #ssh = 22

    # The [UDPMonitor] section lists all the UDP ports on which to listen
    # for data.
    # Each item listed will BIND a UDP port and listen to any data. Keep
    # in mind that this port will be bined and no other application will
    # be able to use this port.
    # There is no default UDP Monitor.
    # Examples:
    # udp-1 = 1025
    # udp-2 = 2048
    [UDPMonitor]
    #udp-1025 = 1025

    # The [IOMonitor] section lists all the processes to Monitor for IO
    # activity. A regular expressions is used to find the processes PIDs, which
    # are later used to monitor IO.
    # There is no default IO Monitor.
    # Examples:
    # kvm-io = "kvm"
    # mysqld-io = "mysql"
    [IOMonitor]
    #kvm-io = "kvm"
    #mysqld-io = "mysql"
    squeezebox="/usr/sbin/squeezeboxserver"
    sabnzbd="/usr/bin/sabnzbdplus"
    proftpd="proftpd:"
    samba = "smbd"


    # The [InputMonitor] section lists the USB Input devices for which to track
    # events. Currently, only two types of devices are supported, mouse and keyboard.
    # Both InputMonitor's are enabled by default. In the case there are no USB
    # devices connected, PowerNap will ignore these settings.
    # To disable, set them to "n" or "no", or simply comment them.
    # Examples:
    # keyboard = n
    # keyboard = y
    [InputMonitor]
    keyboard = y
    mouse = y

    # The [DiskMonitor] section lists the disk devices for which to track
    # standby/sleep status. If any of the devices are active/idle the
    # system will be deemed 'active' and will not powernap. Generally useful
    # for monitoring data drives (e.g. NAS), but will not typically work to
    # monitor the root drive. Note also that this plugin only reacts to the
    # state of the drive and does not modify the behavior of the drive
    # directly. Therefore it only makes sense to monitor a drive that has
    # already been configured to standby or sleep.
    # To disable checking specific drives, set them to "n" or "no",
    # or simply comment them.
    # Examples:
    # sda = y
    # sdb = n
    [DiskMonitor]
    #sda = y

  7. #47
    Join Date
    Nov 2009
    Beans
    27
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Server auto-suspend?

    Thanks very much for that Kaayman

    I never managed to get IOMonitor working even though I tried alsorts. I'll give your config a bash and see if it works.

    >>Now i'm using it with 12.10. For some reason samba is reporting network usage, when it's not used. I adjusted the python script to work around this.

    What did you change to get this working ?

    Cheerio

  8. #48
    Join Date
    Dec 2007
    Beans
    7

    Re: Server auto-suspend?

    Hi

    I tried sleepd, and it works quite nice.
    I simply set it up to suspend if the network activity goes below 20 packet/s
    This threshold is useful because you may have a browser having tcp connections with very few packets.
    It works very well.

    But, I haven't found how to tell it to monitor video players or screensaver. (as video players disable screen saver)
    powernap doesn't seem to have the network monitoring threshold feature.
    Monitoring the server load doesn't seem very robust, as a browser can use cpu for animations for example.

    If someone has a good solution for suspending a home server, not during video playback (player or flash player in browser...) that would be nice.

    I thought about a monitoring process looking at the screensaver.
    Computer can go to sleep if network activity is low and screen dpms is shutdown (monitoring xset q?)
    sleepd can be controled with sleepctl on or off only.

  9. #49
    Join Date
    Apr 2010
    Beans
    3

    Re: Server auto-suspend?

    Hi,

    I still use powernap and it works very well for me. I monitor afpd (when no drive is mounted over the network, server goes to sleep). I haven't figured out yet, how to configure it for smbd though. But since I mainly use Macs within my network this is a working solution.
    Before this approach I monitored ssh. So when I needed the server to "stay alive", I opened up a ssh-session. Closing it leaded to send the server to sleep.

    Cheers
    wanky

  10. #50
    Join Date
    Feb 2011
    Beans
    17

    Re: Server auto-suspend?

    I started to use powernap some weeks ago and I have problems in same machines with USB keyboards & USB mouses.

    Please see my comments at https://bugs.launchpad.net/ubuntu/+s...ap/+bug/872109

    Any idea?

    Josep Pujadas-Jubany
    Last edited by bellera; February 27th, 2014 at 07:22 AM.

Page 5 of 5 FirstFirst ... 345

Tags for this Thread

Bookmarks

Posting Permissions

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