PHP refuses to run pm-suspend?

110 Views Asked by At

So I've got a home server up and running, and have set it up with wake-on-lan, and had a friend manage to wake it from two states away. Great, that way I can run a file server without leaving it powered on all the time. Problem is, after waking it, I can't get it to go back to sleep. Certainly, I could configure it to suspend after x minutes, but then that would leave me buggered if I WANTED it on for some reason.

I've been trying to get php to run pm-suspend, with pretty much no success. I've built a script that I can run with ./script from the terminal and it suspends fine. Php will execute it, it even echos the lines that I want it to, but it just skips over the line that suspends the system like it wasn't even there. Any idea on what I could do to make this work?

1

There are 1 best solutions below

0
On

You could run the server engine(apache/nginx) with the user root. pm-suspendneed root permission.