Scripts to start and stop services
Thomas Springer
th.springer at gmx.net
Mon Sep 12 15:50:24 UTC 2005
Am Montag, den 12.09.2005, 16:35 +0300 schrieb Dotan Cohen:
> I often need to start/stop sendmail, mysql, and apache at once. I
> tried making a script with this contents:
> #!/bin/sh
> /sbin/service sendmail start
> /sbin/service httpd start
>
> I put it in ~/bin and chmod 777 it. But I get permission denied when I
> try to run it because I am not root. I understand that I need sudo but
> I have no idea what to do. Anybody?
>
> Thanks.
>
> Dotan
1. Move it into /root/bin/ || /usr/local/bin
2. The owner should be root and perms 0744
3. Execute: $ su -c /path/scriptname
3b. Add an alias for 3.
Sudo is also helpful here of course.
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050912/8ecf1a65/attachment-0001.sig>
More information about the fedora-list
mailing list