Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28
  1. #11
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Thanks again, just to confirm

    I entered the below command withouth the #

    sudo -u squeezeboxserver sudo /sbin/shutdown -h -k now

    and got exactly the same as before, although I removed the now i.e. and got the following:-


    sudo -u squeezeboxserver sudo /sbin/shutdown -h -k

    Shutdown scheduled for Mon, 27 Aug 2012 08:53:25 +0100, use 'shutdown -c' to can
    cel.

    Broadcast message from root@vortexbox.localdomain (Mon, 27 Aug 2012 08:52:25 +01
    00):

    The system is going down for power-off at Mon, 27 Aug 2012 08:53:25 +0100!

  2. #12
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    I also entered the below command

    sudo cat /etc/sudoers

    ## Sudoers allows particular users to run various commands as
    ## the root user, without needing the root password.
    ##
    ## Examples are provided at the bottom of the file for collections
    ## of related commands, which can then be delegated out to particular
    ## users or groups.
    ##
    ## This file must be edited with the 'visudo' command.

    ## Host Aliases
    ## Groups of machines. You may prefer to use hostnames (perhaps using
    ## wildcards for entire domains) or IP addresses instead.
    # Host_Alias FILESERVERS = fs1, fs2
    # Host_Alias MAILSERVERS = smtp, smtp2

    ## User Aliases
    ## These aren't often necessary, as you can use regular groups
    ## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
    ## rather than USERALIAS
    # User_Alias ADMINS = jsmith, mikem


    ## Command Aliases
    ## These are groups of related commands...

    ## Networking
    # Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient
    , /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig
    , /sbin/mii-tool

    ## Installation and management of software
    # Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

    ## Services
    # Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

    ## Updating the locate database
    # Cmnd_Alias LOCATE = /usr/bin/updatedb

    ## Storage
    # Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe,
    /bin/mount, /bin/umount

    ## Delegating permissions
    # Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

    ## Processes
    # Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

    ## Drivers
    # Cmnd_Alias DRIVERS = /sbin/modprobe

    # Defaults specification

    #
    # Disable "ssh hostname sudo <cmd>", because it will show the password in clear.

    # You have to run "ssh -t hostname sudo <cmd>".
    #
    #Defaults requiretty

    Defaults env_reset
    Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLO
    RS"
    Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
    Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES
    "
    Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
    Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY
    "

    Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin

    ## Next comes the main part: which users can run what software on
    ## which machines (the sudoers file can be shared between multiple
    ## systems).
    ## Syntax:
    ##
    ## user MACHINE=COMMANDS
    ##
    ## The COMMANDS section may have other options added to it.
    ##
    ## Allow root to run any commands anywhere
    root ALL=(ALL) ALL

    ## Allows members of the 'sys' group to run networking, software,
    ## service management apps and more.
    # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOC
    ATE, DRIVERS

    ## Allows people in group wheel to run all commands
    %wheel ALL=(ALL) ALL

    ## Same thing without a password
    # %wheel ALL=(ALL) NOPASSWD: ALL

    ## Allows members of the users group to mount and unmount the
    ## cdrom as root
    # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

    ## Allows members of the users group to shutdown this system
    # %users localhost=/sbin/shutdown -h now

    ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
    #includedir /etc/sudoers.d
    %squeezeboxserver ALL=NOPASSWD:/sbin/shutdown
    %squeezeboxserver ALL=NOPASSWD:/usr/sbin/pm-suspend
    %squeezeboxserver ALL=NOPASSWD:/usr/sbin/pm-hibernate
    %squeezeboxserver ALL=NOPASSWD:/usr/sbin/pm-powersave
    %squeezeboxserver ALL=NOPASSWD:/usr/bin/crontab -l
    %squeezeboxserver ALL=NOPASSWD:/usr/local/sbin/spc-checkidle.sh
    %squeezeboxserver ALL=NOPASSWD:/usr/local/sbin/spc-restart.sh
    %squeezeboxserver ALL=NOPASSWD:/usr/local/sbin/spc-test.sh
    %squeezeboxserver ALL=NOPASSWD:/usr/local/sbin/spc-wakeup_alt.sh
    %squeezeboxserver ALL=NOPASSWD:/usr/local/sbin/spc-wakeup.sh



    "Can you do a shutdown using the Extras/Server Power Control/Shutdown Server entry, either from the web UI or from the player UI?"

    Just to confirm I did try the shut via the SB Touch extra's and it did work

  3. #13
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Quote Originally Posted by gharris999 View Post

    But thinking about it, there's really no particular reason that the behavior you want couldn't become a future SrvrPowerCtrl feature. The tricky bit would be figuring out what to do when there are multiple players. Should all players be 'off' before SrvrPowerCtrl suspends the server? Or should any player going 'off' shut things down if no other players are actively playing? Or should there be a configurable 'master' player?

    What do you think?
    I can see where you're coming from on this on regarding multiple players. It would be good if to shut down if no other players are active, although I think I'd be happy with a configured master player to trigger the shut down.

  4. #14
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Hurrah! I think the Server Power Control is now working

    Not sure what I've done, I added the command in the Help section of Help > Server Power Control

    i.e.

    "To finish installing SrvrPowerCtrl for RedHat and like distros, you'll need to make sure that the following command is available from a terminal prompt:

    sudo shutdown -k -h now
    Additionally, to support suspend and hibernation, the pm-utils package must be installed. Check to see that these commands are run-able from a terminal prompt as well:

    sudo pm-suspend --help
    sudo pm-hibernate --help
    sudo chmod a+x /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/SrvrPowerCtrl/scripts/RedHat/srvrpowerctrl-setup.sh

    sudo /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/SrvrPowerCtrl/scripts/RedHat/srvrpowerctrl-setup.sh

    sudo -u squeezeboxserver /usr/local/sbin/spc-test.sh"


    I'm not sure why I got nothing from the

    sudo -u squeezeboxserver sudo /sbin/shutdown -h -k now

    (I think it's down to user error on my behalf)

    However I'm not so bothered at the moment because my vortexbox can:-

    It shuts down if idle,
    I can shut down the server and the SB Touch if I hold down the sleep button on the remote (thanks for the assistance with that)

    and I can also shut down server using the options on the SB Touch it's self.

    Is there anyway once the server shuts down it can be woken up by WOL?

    At the moment I have to go into the other room, hit the on button on the old desktop and then switch on the SB player.

    Any suggestions how I can wake up the server remotely?

  5. #15
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,303
    Quote Originally Posted by MrClive View Post

    Is there anyway once the server shuts down it can be woken up by WOL?

    At the moment I have to go into the other room, hit the on button on the old desktop and then switch on the SB player.

    Any suggestions how I can wake up the server remotely?
    it depends on how old that "old desktop" is that you've got there. If you're talking circa 2006 or older, I think it's doubtful. On Fedora, you can check the WOL status of your NIC using the ethtool utility, e.g.

    ethtool -A devname

    See: http://linuxmanpages.net/manpages/fe...ethtool.8.html

    Otherwise, see http://forums.slimdevices.com/showth...-favorite-mobo for info on a relatively low cost motherboard that supports WOL.

  6. #16
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Cheers gharris999,

    the headless desktop that I'm running it on was a 2nd hand Compac and given to me, so not sure exactly how old it is, but my guess would be at least 5 years old at the very least.

    Will give the ethtool a go to confirm.

    Food for thought on the kit that you've listed.

    I've never done or thought of building any like that myself, but it may be worth looking at if I can put a spec together and price it up

    Thanks again for your help.

  7. #17
    Senior Member
    Join Date
    Apr 2008
    Location
    Paris, France
    Posts
    1,469
    MrClive,

    You must have a look at the PM events table on the comp in addition to using ethtool ("cat /proc/acpi/wakeup".) If you see things like this, and assuming the ethernet card is connected on this port ("lspci -vv" will tell you somehow)…
    Code:
    PCI1	  S3	*disabled   pci:0000:00:1e.0
    …you need to "echo PCI1 > /proc/acpi/wakeup" to change the status to "enabled". Then the WOL received and processed by the card would be propagated to the OS, and hopefully the PC would wake-up. And not hang during wake-up.
    You would need to put the appropriate echo line in a boot script, such as /etc/rc.local, because changes to /proc/ are not sticky across reboots. This example line mentions "S3" which means suspend: WOL from suspend would work, and probably WOL from soft off (S5). If you read S5 instead of S3, there is a chance wakeup won't work at all regardless of what ethtool says. S4 means hibernate.

    If the comp wakes from suspend or hibernate, you could compare power consumption in this mode and in power off mode. Hibernate is "save state to disk, then soft-off" so power draw should read the same. But I would say there is a good chance that this old machine draws the same amount of power in suspend mode as well. If that's true, then you might consider using this state instead of shutting down.

    (I am right now in the process of circumventing the power management oddities of a Dell PC circa 2005 using controlled power feed. Long story short, this is a potentially complex and most probably cost-ineffective way of doing things. But if the computer has a BIOS setting to power-up after mains power loss, you could consider that possibility, too.)

    Good luck!
    4 SB 3 • iPeng (iPhone + iPad) • SqueezeLite • Squeezebox Server 7.6.2 (Debian 6.0) with plugins: CD Player, WaveInput by bpa • IRBlaster by Gwendesign (Felix) • Server Power Control by Gordon Harris • Smart Mix by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • Just Covers by Tom Kalmijn • WeatherTime by Martin Rehfeld • Local Player, BBC iPlayer, SwitchPlayer by Triode • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

  8. #18
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Thanks epoc1970

    I have look at this tonight, and see how I get on....I'm not going to pretend that I understand more that 40% of what you've said there.

    If you know of a "setting up WOL beginners guide for Dummies" could you forward it my way.

  9. #19
    Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    50
    Thanks for all of you help.

    First hurdle when using ethtool is it's not recognising vortexbox as the devname

    e.g.

    [vortexbox.localdomain ~]# ethtool vortexbox
    Settings for vortexbox:
    Cannot get device settings: No such device
    Cannot get wake-on-lan settings: No such device
    Cannot get message level: No such device
    Cannot get link status: No such device
    No data available
    [vortexbox.localdomain ~]#

    Am I being a complete numpty?


    However I have got the following command to work

    [vortexbox.localdomain ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:0C:76:86:12:99
    inet addr:192.168.0.7 Bcast:192.168.0.255 Mask:255.255.255.0
    inet6 addr: fe80::20c:76ff:fe86:1299/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:79638 errors:0 dropped:2 overruns:0 frame:0
    TX packets:112787 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:7031958 (6.7 MiB) TX bytes:155131589 (147.9 MiB)
    Interrupt:23 Base address:0x2000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:22333 errors:0 dropped:0 overruns:0 frame:0
    TX packets:22333 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2650210 (2.5 MiB) TX bytes:2650210 (2.5 MiB)

    [vortexbox.localdomain ~]# ethtool -i eth0
    driver: 8139too
    version: 0.9.28
    firmware-version:
    bus-info: 0000:01:0c.0
    supports-statistics: yes
    supports-test: no
    supports-eeprom-access: no
    supports-register-dump: yes
    [vortexbox.localdomain ~]#

  10. #20
    Senior Member
    Join Date
    Apr 2008
    Location
    Paris, France
    Posts
    1,469
    You're getting there
    Forgo the this prized '-i' option and you should see more data. That will be "ethtool eth0". Or perhaps "sudo ethtool eth0", if you are not the admin user 'root', or a user in the admin group.

    For example on the old Dell I have this kind of output:
    Code:
    $ sudo ethtool eth0
    Settings for eth0:
    	Supported ports: [ TP MII ]
    	Supported link modes:   10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	Supports auto-negotiation: Yes
    	Advertised link modes:  10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	Advertised pause frame use: Symmetric
    	Advertised auto-negotiation: Yes
    	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
    	                                     100baseT/Half 100baseT/Full 
    	Link partner advertised pause frame use: Symmetric
    	Link partner advertised auto-negotiation: Yes
    	Speed: 100Mb/s
    	Duplex: Full
    	Port: MII
    	PHYAD: 0
    	Transceiver: internal
    	Auto-negotiation: on
    	Supports Wake-on: pumbg
    	Wake-on: g
    	Current message level: 0x00000007 (7)
    	Link detected: yes
    The ' Supports Wake-on: ' and ' Wake-on: ' bits are of interest.
    If your report does not include the letter 'g' on the 'Supports Wake-on:' line, then WOL by "magic packet" will not work. If the line is not empty, all is not lost, however.

    If the line 'Supports Wake-on:' contains indeed the letter 'g', as above, BUT the line 'Wake-on:' says 'd', then it is a good sign. 'd' means disabled.
    To enable, you will want to type: "sudo ethtool -s eth0 wol g" (nevermind the sudo if it works without) and then see if the above command reports a change.

    If both lines contain already 'g', then the future looks a little dark. Cut and paste the contents of "lspci -tv" and "cat /proc/acpi/wakeup", maybe it's a matter of PM event routing (as per my previous cryptic message)

    I understand you try waking the machine from soft-off. Maybe an immediate test will be unsuccessful, as there is a possibility that Fedora resets the card settings right before halting the machine. (The ones who want a good night's sleep like such a silly feature.)
    I don't use Fedora at all, but this howto indicates that you need to have on the system a file called "/etc/sysconfig/network-scripts/ifcfg-eth0", with inside a line saying (at minimum) 'ETHTOOL_OPTS="wol g"' to make the setting sticky.
    Last edited by epoch1970; 2012-08-29 at 09:48.
    4 SB 3 • iPeng (iPhone + iPad) • SqueezeLite • Squeezebox Server 7.6.2 (Debian 6.0) with plugins: CD Player, WaveInput by bpa • IRBlaster by Gwendesign (Felix) • Server Power Control by Gordon Harris • Smart Mix by Michael Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by Erland Isaksson • Just Covers by Tom Kalmijn • WeatherTime by Martin Rehfeld • Local Player, BBC iPlayer, SwitchPlayer by Triode • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.

Tags for this Thread

Posting Permissions

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