Gentlemen,

Moving forward from my previous FreeRadius enlightenment, FR Config Sanity Checking, I need to restart the FreeRadius daemon on the remote system.

I am authorized through SSH keys to the remote server to scp the generated configuration files to said server, however, I am having trouble reloading in order for the changes to take effect.

Below is the code, that I have in the propagate function.
####### Begin Dumb Propagate Function ####### foreach $addr (keys %FR_servers) { if( system("sudo /usr/bin/scp -Bpq $config_file $addr: +/usr/local/etc/raddb/") == 0 ){ $FR_servers{$addr} = 1; # mar +k for user feedback } else { $FR_servers{$addr} = 0;} if( system("sudo /usr/bin/scp -Bpq $users_file $addr:/ +usr/local/etc/raddb/") == 0){ $FR_servers{$addr} = 1; } else { $FR_servers{$addr} = 0;} system("sudo ssh $addr $reloadcmd"); # reload freeradi +us remotely } ####### Finish Dumb Propagate Function #######
This is the string that I send as $reloadcmd.
# command for reloading FreeRadius configuration # touching the file works on both local and remote filesystems my $reloadcmd = "/usr/local/sbin/rc.radiusd reload > /tmp/reload_ouput +"; #"/bin/touch /tmp/test_reload_config";
The file /tmp/reload_output on the local file system has output, however, the remote system doesn't have the redirected output.

Changing the command to a 'sudoed' command, results in the script spinning for a while, but the same result.

You will also see that when I 'touch' a file on the remote filesystem that that file appears.

Many thanks in advance, I want to get this done before I go on vacation ;)

amt.

perlcheat

In reply to FR Reload Issues by amt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.