Page 1 of 1

linux command

Posted: Tue Aug 21, 2007 12:28 am
by jan_sc
hi,

i'm new to linux and have a question on the linux command. what does the "restart" means in the command line "./program-name restart"?

tia.

cheers.

Posted: Tue Aug 21, 2007 5:46 am
by timvw
Depends on the application you're using... consult it's manual.

Posted: Tue Aug 21, 2007 6:35 am
by Chris Corbyn
I'll guest you're talking about daemons:

Code: Select all

/etc/rc.d/apache2 restart
That basically tells whatever service it handles to "stop" and then "start".

Posted: Tue Aug 21, 2007 7:56 pm
by jan_sc
hi,

unfortunately, there's no manual available. here is my scenario:
i had made some changes to the php files but the changes were not reflecting in the internet browser. then, i found out that there are 4 web servers running the same application and i saw the command "./program-name restart" was written somewhere with a brief description "to sync all files to all servers". i suppose i need to execute that command but wasn't sure of the impact and just afraid so as it is a production server and running 24x7.

any helps are very much appreciated.

tia.

Posted: Wed Aug 22, 2007 12:44 am
by timvw
I understand that your not to keen to run the application (since you have no clue about what it's going to do)... But if you were us, how would you expect us to know the application 'program-name'?

Thus, unless you give more information about the application (probably it's just a wrapper script for a couple of commands...) we won't be able to help you...

Posted: Wed Aug 22, 2007 2:32 am
by jan_sc
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi,

thanks for your input timvw. just got to know the command "more" to diplay file content. this is the content:

[syntax="bash"]case "$1" in
boot)
        echo -n "Cleaning up PRODUCTION tmp files........................."
        rm -f /tmp/rdist.lck
        rm -f /tmp/rdist.log
        echo "[OK]"
        exit 0;
        ;;

restart)
        $0 boot
        ;;
*)
        echo "Usage: ./sync_production [boot|restart]"
        exit 1
esac


if [ -f /tmp/rdist.lck ]; then
        exit 0
fi


/bin/touch /tmp/rdist.lck

/usr/bin/rdist -p /usr/sbin/rdistd -oremove,nochkgroup,nochkmode,nochkowner -f /
root/sync-production.conf

rm -f /tmp/rdist.lck

echo `date` > /tmp/rdist.log

exit 0
tia.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Aug 22, 2007 4:25 am
by jan_sc
sorry. missed out the content of sync-production.conf

Code: Select all

HOSTS = (root@ap01 root@ap02 root@ap03 root@ap04)

FILES = (/usr/local/apache/htdocs/production)
EXCEPT = (/usr/local/apache/htdocs/production/temp)

${FILES} -> ${HOSTS}
        install ;
        except ${EXCEPT} ;

Posted: Wed Aug 22, 2007 5:17 am
by timvw
So, the important command is (the rest is simply creating of lock and log files)

/usr/bin/rdist -p /usr/sbin/rdistd -oremove,nochkgroup,nochkmode,nochkowner -f /root/sync-production.conf


(So consult man rdist)