[lug] Newbie question

D. Stimits stimits at idcomm.com
Thu Jul 12 11:25:28 MDT 2001


Kirk Ellsworth wrote:
> 
> I want to start and stop postgresql, apache, and sendmail at the same
> time with ease.  How could I put this into a script and name the script
> "horde services stop".

Depends on the distribution used. I think apache has its own apachectl
command, but most every distro has the ability to use /etc/rc.d/init.d/
files (or another init.d directory elsewhere if non-RH) with arguments
"stop, start, restart". E.G., on RH:
/etc/rc.d/init.d/httpd restart  (this is for apache)
/etc/rc.d/init.d/postgresql stop
/etc/rc.d/init.d/sendmail start

> 
> Also how do I run a .sql file?  I also need to attach a "\i" to the
> command???

You can't run .sql files, they are data rather than programs. Depending
on the SQL server, there is usually a script command to run .sql files
as a script though. I don't know what the postgresql command is to run
sql scripts, which probably in turn depends on what kind of sql client
program you access the db server from.

D. Stimits, stimits at idcomm.com

> 
> Kirk
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list