Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
04-05-2017, 08:44 AM
|
#1
|
Member
Registered: Oct 2009
Posts: 106
Rep:
|
How to wake PC from sleep mode for scheduled recordings.
Hello,
After a few teething problems, I am now running TVHeadend on Openmediavault 3.0 and everything is working well.
The problem is, I have to leave the PC on all the time for schedules recordings to run.
Is there any easy way to have the PC suspend to RAM after 10 minutes of inactivity but also automatically wake up for upcoming recordings?
Thanks.
|
|
|
04-05-2017, 11:39 AM
|
#2
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,529
|
Quote:
Originally Posted by elsmandino
Is there any easy way to have the PC suspend to RAM after 10 minutes of inactivity but also automatically wake up for upcoming recordings?
|
The clue is in the work "suspend", it stops things... that's how suspend works.
If you're looking for a way to save power then consider doing something like using a low-power device like a RasPi to do your recordings, or use the RasPi to fire a "Wake On Lan" packet to your PC at the appropriate time.
|
|
|
04-05-2017, 11:58 AM
|
#3
|
Member
Registered: Oct 2009
Posts: 106
Original Poster
Rep:
|
I hate to make comparisons with Windows on Linux forums but my current Windows 10 server has options to allow me tell it to sleep after 10 minutes and automatically resume from sleep for recordings. Most of the day it just sits there, in sleep mode, waking up to record, and then going back to sleep.
Is this control not available in Linux?
|
|
|
04-05-2017, 12:03 PM
|
#4
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,529
|
There's a difference between "sleep" and "suspend".
Sleep is effectively a low power consumption mode that shuts down a lot of external hardware and (with the right processor) slows the clock on the processor to save power. This allows certain processes to continue executing in the background.
Suspend writes the content of RAM to the HD and stops all processes, when the PC comes out of sleep the contents of RAM are reloaded and processes resume.
|
|
|
04-07-2017, 12:04 PM
|
#5
|
Member
Registered: Oct 2009
Posts: 106
Original Poster
Rep:
|
Sorry - it seems that I have muddied the waters by using different terms.
According to this:
https://en.wikipedia.org/wiki/Sleep_mode
Sleep mode (Windows) = Suspend to RAM (Linux)
Hibernatiion (Windows) = Suspend to Disk (Linux)
How do you go about setting a Linux PC to "Suspend to RAM" after a certain period of inactivity?
|
|
|
04-07-2017, 12:19 PM
|
#6
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by elsmandino
How do you go about setting a Linux PC to "Suspend to RAM" after a certain period of inactivity?
|
most linux distributions come with some gui utility called power management or some such; there you'd simply choose appropriate options & timeouts.
which desktop environment (if any) does openmediavault use?
but i'm sure it can be done with command line also.
|
|
|
04-11-2017, 04:28 PM
|
#7
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,950
|
Sorry for the delay in replying, but you can suspend to RAM with automatic wake-up at a preset time.
See the man page of rtcwake, in which you can set either an absolute time to wake up or a relative time to wake up a suspend to RAM.
There is also a pm-suspend command if you want to do an immediate suspend to RAM.
I expect you have to run these commands as root.
rtcwake works on my desktop.
|
|
|
04-12-2017, 08:56 AM
|
#8
|
Member
Registered: Oct 2009
Posts: 106
Original Poster
Rep:
|
Bit of an update on this one.
I have decided to switch to Ubuntu Server (16.04LTS) instead - reason being that OMV just didn't seem very stable on my system. Furthermore, the support for Ubuntu is so much bigger that I am finding it much easier to find the answers for all the numerous questions I have.
What I have found, is this, which seems to offer exactly what I want - i.e. put the server into a lower powered state whenever it is idle and then wake it up for any scheduled recordings:
https://github.com/git-developer/autosuspend
I know that Ubuntu is Debian-based. Given that the author used this on Debian 8.0, do you think it should work on my server?
|
|
|
04-12-2017, 10:36 AM
|
#9
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,950
|
I'm not using systemd...
I only tested a single user signed on and set the suspend criteria via GUI as suspend to RAM after one hours keyboard inactivity.
This works.
I set up a root cron job to reissue the wakeup call each morning.
However, if a second GUI user signs on before the suspend takes place, the first user asks for a password, preventing the suspend.
So it doesn't work properly.
Sorry.
It's clearly going to be rather tricky to run cron jobs when the machine is suspended to RAM for part of the day.
|
|
|
04-12-2017, 11:06 AM
|
#10
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
Quote:
Originally Posted by elsmandino
I hate to make comparisons with Windows on Linux forums but my current Windows 10 server has options to allow me tell it to sleep after 10 minutes and automatically resume from sleep for recordings. Most of the day it just sits there, in sleep mode, waking up to record, and then going back to sleep.
Is this control not available in Linux?
|
Therefore in theory is can be done in Linux too. perhaps by the same means. a script with the sleep command perhaps being the most elementary means of doing this.
call os to sleep by normal means then set the command sleep for whatever amount of time needed. Then when that time is up figure out how to wake it up then call it to make whatever records it needs. Then check to be sure all said records are created and stored then call it to go to sleep again.
repeat
|
|
|
04-12-2017, 12:18 PM
|
#11
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,950
|
The difficulty is that Linux is a multi-user operating system.
|
|
|
04-12-2017, 12:57 PM
|
#12
|
Member
Registered: Sep 2016
Location: USA
Posts: 275
Rep:
|
This would be called Wake-on-LAN, check out the Arch wiki about Wake-on-LAN as it has a guide on how to do it
Last edited by linux4evr5581; 04-12-2017 at 02:57 PM.
|
|
|
04-12-2017, 01:23 PM
|
#13
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,950
|
Wake-on-LAN would require a second computer, for example a Raspberry Pi, to remain continuously active so as to send the wake-up packet at the appropriate time.
But it might be a reliable method.
|
|
|
04-12-2017, 01:49 PM
|
#14
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by elsmandino
|
i haven't looked at the code, but so far it looks like a viable solution.
but you should look at the code. this is not the sort of software to install & it works.
|
|
|
04-12-2017, 02:28 PM
|
#15
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
yet is not Windows to a mulit-user OS? because one can have more then one user, but never mind -- it is not a server mulit-user system per se' where ones can log in on a single Windows 10 via a dummy terminal. or can they? I have not kept up with Windows... sorry to say just kidding about being sorry on that one.
but that wake up on LAN was my first thought when I read the OP Q.
Last edited by BW-userx; 04-12-2017 at 02:29 PM.
|
|
|
All times are GMT -5. The time now is 11:45 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|