Re: [GTALUG] Sudo in Script

2019-09-15 Thread John Sellens via talk
On Sun, 2019/09/15 12:01:28PM -0400, Stephen via talk  wrote:
| I restart Apache in a script file that requires a Sudo command. That
| requires a password.

Look up the "NOPASSWD" tag in the sudoers(5) man page.

You could set one or more users or groups to be able to run
apachectl graceful
(or any other command) without requiring a password.
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Sudo in Script

2019-09-15 Thread Stephen via talk

On 2019-09-15 12:14 p.m., Kevin Cozens via talk wrote:

On 2019-09-15 12:01 p.m., Stephen via talk wrote:

When debugging I like to clear the Apache error file and save as null.

To continue error logging I have to restart Apache.

1) Not a big deal, but is there an easier way?


Yes, there is. You can move the files to a different name to indicate 
they are older log files then send a signal to Apache to tell it to 
start using new log files.


You can find the details about it at:
 ?? https://www.thegeekstuff.com/2011/07/rotate-apache-logs/


I always learn when I ask for help in this group!

Thank you!

--
Stephen
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Sudo in Script

2019-09-15 Thread William Park via talk
I think you're supposed to first "stop" apache, delete the logs, and
then "start" apache.  Anyways, to "sudo" without a password, do as root,
cd /etc/sudoers.d
echo "user ALL = (ALL) NOPASSWD: ALL" >> user
chmod 440 user
-- 
William Park 

On Sun, Sep 15, 2019 at 12:01:28PM -0400, Stephen via talk wrote:
> I do work in a LAMP system.
> 
> When debugging I like to clear the Apache error file and save as null.
> 
> To continue error logging I have to restart Apache.
> 
> 1) Not a big deal, but is there an easier way?
> 
> I restart Apache in a script file that requires a Sudo command. That
> requires a password.
> 
> 2) Can I provide the password in the script file to avoid the prompt and
> save a little time?
> 
> Thanks!
> -- 
> Stephen
> ---
> Post to this mailing list talk@gtalug.org
> Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Sudo in Script

2019-09-15 Thread Kevin Cozens via talk

On 2019-09-15 12:01 p.m., Stephen via talk wrote:

When debugging I like to clear the Apache error file and save as null.

To continue error logging I have to restart Apache.

1) Not a big deal, but is there an easier way?


Yes, there is. You can move the files to a different name to indicate they 
are older log files then send a signal to Apache to tell it to start using 
new log files.


You can find the details about it at:
  https://www.thegeekstuff.com/2011/07/rotate-apache-logs/

--
Cheers!

Kevin.

http://www.ve3syb.ca/   | "Nerds make the shiny things that
https://www.patreon.com/KevinCozens | distract the mouth-breathers, and
| that's why we're powerful"
Owner of Elecraft K2 #2172  |
#include  | --Chris Hardwick
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


[GTALUG] Sudo in Script

2019-09-15 Thread Stephen via talk

I do work in a LAMP system.

When debugging I like to clear the Apache error file and save as null.

To continue error logging I have to restart Apache.

1) Not a big deal, but is there an easier way?

I restart Apache in a script file that requires a Sudo command. That 
requires a password.


2) Can I provide the password in the script file to avoid the prompt and 
save a little time?


Thanks!
--
Stephen
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk