Linux / UNIX Tech Support Forum
This is a discussion on Cannot execute a script within the Mail Servers forums, part of the Mastering Servers category; Hi All, I am writing a script which will start the postfix services on some set of servers. For example ...
|
|||||||
| Mail Servers Discussion on Postfix/Sendmail Mail servers and related program such as IMAP/POP3, Anti-Spam technologies. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All,
I am writing a script which will start the postfix services on some set of servers. For example , I do not want to log in to server and start the postfix service remotely for time convenience. I have written the below script. Code:
#!/bin/sh
for i in `cat /home/vaibhavk/iad`; do
echo -n "$i -"
if ping -nqc 2 $i >/dev/null; then
ssh $i 'date ; /usr/local/etc/rc.d/postfix reload '
echo -n " " ; ssh root@$i 'date'
else
echo " unreachable..."
fi
done
Code:
cat iad system2.abc.com system3.abc.com I am getting the below error when I am trying to execute the script %sh postfix.sh system.abc.com -Wed Jun 24 06:22:52 UTC 2009 eval: cannot open /var/spool/postfix/pid/master.pid: Permission denied postfix not running? (check /var/spool/postfix/pid/master.pid). ^C harry# sh postfix.sh (root priviledges) [script is saved on harry.abc.com] system.abc.com -Password: Password: Could you please figure out the issue in the above script. Regards, Vaibhav Last edited by nixcraft; 06-24-2009 at 04:35 PM. |
| Sponsored Links | ||
|
|
|
||||
|
To restart postfix use
Code:
/usr/local/etc/rc.d/postfix restart
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to execute shell script from any where | kar | Shell scripting | 3 | 05-19-2009 04:10 AM |
| Shell Script To Add Execute permission to the file for the user | midomax | Shell scripting | 5 | 03-12-2009 12:35 AM |
| Execute UNIX Command / Shell Script Once In The Future | permalac | Shell scripting | 2 | 08-27-2008 08:13 PM |
| If file modified execute a script | karabaja | Shell scripting | 3 | 11-23-2006 02:39 AM |
| #why following cannot be execute? | ryan | Shell scripting | 7 | 03-16-2005 06:50 PM |