Re: shutdown machine from crontab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/16/2015 02:06 PM, Ranjan Maitra wrote:

On Wed, 16 Sep 2015 11:05:36 -0800 Antonio Olivares <wingators@xxxxxxxxx> wrote:



-----Original Message-----
From: maitra.mbox.ignored@xxxxxxxxx
Sent: Tue, 15 Sep 2015 20:12:22 -0500
To: users@xxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: shutdown machine from crontab

Hi,

Can you try:

systemctl poweroff

instead of /usr/bin/poweroff and see if that works?

Many thanks and best wishes,
Ranjan


Ranjan,

Tried it and it does not poweroff machine via crontab.  However, from
$ systemctl poweroff

does poweroff machine.  What could be preventing it from shutting down.  I will try the -f option suggested also, then report back.

Best Regards,


Sorry, I do not have any idea:  you could try /usr/bin/systemctl poweroff but this is just a random stab...

I'm pretty sure this is caused by the fact that crontab entries don't
have a console associated with them and systemctl wants to spit stuff
out to stdout.  You could try redirecting stdout and stderr in your cron
entry:

	systemctl poweroff >/dev/null 2>&1

or possibly launch systemctl in a screen session:

	screen -S "sysshutdown" -d -m systemctl poweroff

The first MAY work (dunno if systemctl is that picky). The second would
run it in a screen session so it would have a stdin, stdout and stderr.
That is assuming you have screen installed (and why wouldn't you?). If
it failed you could "screen -r" and see what error systemctl is
spitting out.

This is just a guess.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-          When all else fails, try reading the instructions.        -
----------------------------------------------------------------------
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux