in reply to Re: FR Reload Issues
in thread FR Reload Issues

samtregar, thank you for the direction. This was intent of this post, not the knock em dead answer.

cheers.
Update
Taking your suggestion, I am returned with:
Failed to 'sudo ssh 192.168.1.243 /usr/local/sbin/rc.radiusd reload > +/tmp/reload_ouput': 0 at /usr/local/nagios/perl/radpass.pl line 1184.

I don't understand why I could be getting a 0 for $?. I tried removing the redirection of the output, but I still get 0. My system call isn't returning a -1, so it's being accepted.
amt.

perlcheat

Replies are listed 'Best First'.
Re^3: FR Reload Issues
by samtregar (Abbot) on Nov 03, 2004 at 19:14 UTC
    Try replacing the command with something simpler like:

    system("sudo ssh $addr echo Hello") && die("Failed to 'sudo ssh $addr echo Hello': $?");

    If that works then you know the problem isn't with sudo or ssh. You need to look at $reloadcmd and figure out why it's failing. You haven't told us anything about this code so it's hard to know why it might exit(0).

    -sam

      samtregar, I did replace the complex command with a simpler command. I replaced it with touch and the touch command executed, I thought that I mentioned that in my first post, that is why I am so baffled at why it is exit(0). I have also tried redirecting the output of the execution to a file, and the remote server doesn't create that file, but the localhost does.

      I am logging into the remote server with a SSH key as root, when I'm executing that command, so I don't know why the command would fail.
      amt.

      perlcheat