Re: shutdown of linux box from cron perl script

From: Eric Peterson (lastname_nospam_at_heritage.nv.gov)
Date: 01/07/05


Date: Fri, 07 Jan 2005 00:02:25 GMT

PS. I forgot to say just how I've tried to command the shutdown from perl:
  system "shutdown -r now";
  `shutdown -r now`;
and variations with 10 second delay, or with and without a newline (\n)

"Eric Peterson" <lastname_nospam@heritage.nv.gov> wrote in message news:...
> Sorry for the cross-posting, but I'm not sure if this question lands on
the
> perl side of things, or the linux side...
>
> I have a perl script that runs once a minute to check various things.
Under
> one condition I want it to reboot the system. The command line equivalent
> of "shutdown -r 10". I can get the script to work perfectly if I manually
> run it from the command-line, "./myshutdownscript.pl". But when it runs
> automatically from cron, the shutdown command seems to be ignored, though
> all other output indicates the perl script is running fine.
>
> Any suggestions?
>
> Using: Debian Sarge, kernel 2.6, pentiumIII box, Perl 5.8.4
>
> Thanks!
> -Eric
>
>



Relevant Pages

  • RE: setting unix command through perl script
    ... I am automating one task in Perl in which this command is ... If I don't execute this command then entire task would fail. ... setting unix command through perl script ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ...
    (perl.beginners)
  • Re: command line with -e
    ... specify a Perl script directly on the command line instead of saving it ... It is exactly the same Perl code and has exactly the same ... First I am not sure how all those shell escapes work ... then this is the one and only statement in your Perl script. ...
    (comp.lang.perl.misc)
  • RE: setting unix command through perl script
    ... I am automating one task in Perl in which this command is ... If I don't execute this command then entire task would fail. ... setting unix command through perl script ...
    (perl.beginners)
  • Re: Displaying a users group memberships
    ... Perl script. ... The user's username is passed to the script via the command ... line and captured with ARGV. ...
    (perl.beginners)
  • Re: Displaying a users group memberships
    ... Perl script. ... The user's username is passed to the script via the command ... perldoc -f split ...
    (perl.beginners)