Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[4] 01:46:11 [FAILURE] 158.69.1**.*** Exited with error code 127
Stderr: bash: sed -i 's:#etc/init.d/boinc start:/etc/init.d/boinc start:g' /usr/bin/global_prefs_override.xml: No such file or directory
Is it GNU sed on all the other machines? Or do you need something fully portable? If GNU sed is present on each, then you might see if it is the pound sign causing the trouble and write it as octal instead:
Is it GNU sed on all the other machines? Or do you need something fully portable? If GNU sed is present on each, then you might see if it is the pound sign causing the trouble and write it as octal instead:
I wonder if the problem isn't parallel-ssh there. Looking at the manual page for it, I don't see much anything standing out in the way of advantages over the normal SSH client launched with a while loop. Are you using any special features of Parallel-SSH or just the ability to read targets from a list?
I use it to send commands from one machine to a bunch of other machines. I have eight dedicated servers that I run BOINC on and 16 Pi 4's that I also use for BOINC. with pssh I can send one command from one machine and get it applied on all machines that I have in the hosts_file.txt.
If there is a simpler way then I am open to suggestions but I am not a programmer so it would have to be easy to follow..
I use it to send commands from one machine to a bunch of other machines. I have eight dedicated servers that I run BOINC on and 16 Pi 4's that I also use for BOINC. with pssh I can send one command from one machine and get it applied on all machines that I have in the hosts_file.txt.
If there is a simpler way then I am open to suggestions but I am not a programmer so it would have to be easy to follow..
Thanks.
Although there has been a bit of drift, all GNU/Linux systems are at their heart IDEs. So they are built around programming and scripting and, in reality, all interaction through the shell interpreter is actually scripting. So with that caveat:
Code:
while read host; do
ssh $host "sed -i.bak 's:#etc/init.d/boinc start:/etc/init.d/boinc start:g' /usr/bin/global_prefs_override.xml"
done < hosts_file.txt
So while on the surface that looks like it adds two lines, underneath it allows use of the normal SSH client and re-uses pre-existing shell skills. Knowledge of shell scripting is a highly useful skill even with a small investment of time.
Maybe parallel-ssh is more appropriate, especially if you have hundreds or thousands of machines. However, the option for normal shell work is always.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.