# Restart Nginx than root user?

**URL:** <https://www.ruby-forum.com/t/restart-nginx-than-root-user/243907>\
**Category:** NGINX\
**Created:** [January 25, 2016, 12:28am UTC](https://www.ruby-forum.com/t/restart-nginx-than-root-user/243907 "2016-01-25T00:28:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [January 25, 2016, 12:28am UTC](https://www.ruby-forum.com/t/restart-nginx-than-root-user/243907/1 "2016-01-25T00:28:33Z")

</div>

Hi Team,  
root user is must for NGinx restart?  
Everytime of restart, prompts for root user than other users. PID’s are  
not  
getting killed…for the running process with project users.

I tried solution of adding entry to Sudoers file with an path of  
executable  
script. No luck. Following are the changes made

/ectc/sudoers  
%gvp ALL=NOPASSWD: /var/gvp/Nginx/bin/restartNginx #To get rid of Nginx  
restart with root user and to attain with gvp user

/var/gvp/Nginx/bin/restartNginx  
#! /bin/bash  
/bin/kill -HUP `cat /var/gvp/Nginx/nginx-1.8.0/logs/nginx.pid`

Please review, if above instructions are correct.

And, suggest how project users can be used to restart NGinx…to avoid  
manual intervention and dependency of root user always.

Regards,  
Maddy

Posted at Nginx Forum:

> **[Restart Nginx than root user?](https://forum.nginx.org/read.php?2,264087,264087#msg-264087)**
>
> Hi Team, root user is must for NGinx restart? Everytime of restart, prompts for root user than other users. PID's are not getting killed...for the running process with project users. I tried solution of adding entry to Sudoers file with an path of...

---

<div class="post-metadata">

**Author:** ![smsmaddy1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@smsmaddy1981](https://www.ruby-forum.com/u/smsmaddy1981)\
**Post date:** [January 25, 2016, 2:41am UTC](https://www.ruby-forum.com/t/restart-nginx-than-root-user/243907/2 "2016-01-25T02:41:44Z")

</div>

HI,

On 01/25/2016 12:27 PM, smsmaddy1981 wrote:

> restart with root user and to attain with gvp user
> 
> Regards,  
> Maddy
> 
> Posted at Nginx Forum:  
> [https://forum.nginx.org/read.php?2,264087,264087#msg-264087](https://forum.nginx.org/read.php?2,264087,264087#msg-264087)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)  
> You only need root privileges if you are trying to open a port with a  
> number lower than 1024 ( might be 1000, been a while! ). You could set  
> the setuid privileges on the start script, and run it that way…  
> however, most linux shells will forbid that for security reasons.

Your sudo solution should work fine, and really is the best one. Here’s  
an entry on one of my servers to allow user alchemy to manage apache ( I  
know, they’re in the stone age! ) on debian wheezy… I just provide  
them access to the standard System V init scripts via the service  
command

# cat /etc/sudoers.d/alchemy

alchemy ALL = NOPASSWD: /usr/sbin/service apache2 \*

Steve

–  
Steve H. BSc(Hons) MIITP

> **[Linux & Admin Support Services | "Services provided by people who are proud...](https://www.greengecko.co.nz/)**
>
> Offers linux support services, systems and database administration, consultancy and the full development lifecycle for open source - based solutions

Linkedin: [Steve Holdoway - Robotron New Zealand Limited | LinkedIn](http://www.linkedin.com/in/steveholdoway)  
Skype: sholdowa

---

<div class="post-metadata">

**Author:** ![smsmaddy1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@smsmaddy1981](https://www.ruby-forum.com/u/smsmaddy1981)\
**Post date:** [February 3, 2016, 11:32pm UTC](https://www.ruby-forum.com/t/restart-nginx-than-root-user/243907/3 "2016-02-03T23:32:34Z")

</div>

Hi Steve, Thanks for your email.

And, Is the same solution what I have described in my initiated email.  
No  
luck there.

Any other suggestions please?

Posted at Nginx Forum:

> **[Re: Restart Nginx than root user?](https://forum.nginx.org/read.php?2,264087,264318#msg-264318)**
>
> Hi Team, root user is must for NGinx restart? Everytime of restart, prompts for root user than other users. PID's are not getting killed...for the running process with project users. I tried solution of adding entry to Sudoers file with an path of...
