Welcome! Log In Create A New Profile

Advanced

nginx: invalid option: "-s start"

Posted by helloData 
helloData
nginx: invalid option: "-s start"
May 31, 2018 09:40PM
Hi,

I am trying nginx for the first time. I installed and tried "sudo nginx -s
start". However, I got error. Here is the detail:

a) I am using Ubuntu on x64 (LinuxMint Sonya).
b) Configuration file is located at /etc/nginx
c) There is no nginx.pid initially, but it appears at /var/run when I run
"sudo nginx"
d) After step (c), I ran "sudo nginx -s start" but got this error "nginx:
invalid option: "-s start".
e) However, after the failed attempt (d), I could do "sudo nginx -s stop"
without any error.

Any way to solve the error problem?

Thanks.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280005,280005#msg-280005

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Patrick Chkoreff
Re: nginx: invalid option: "-s start"
May 31, 2018 10:00PM
helloData wrote on 05/31/2018 03:37 PM:
> Hi,
>
> I am trying nginx for the first time. I installed and tried "sudo nginx -s
> start". However, I got error. Here is the detail:
>
> a) I am using Ubuntu on x64 (LinuxMint Sonya).
> b) Configuration file is located at /etc/nginx
> c) There is no nginx.pid initially, but it appears at /var/run when I run
> "sudo nginx"
> d) After step (c), I ran "sudo nginx -s start" but got this error "nginx:
> invalid option: "-s start".
> e) However, after the failed attempt (d), I could do "sudo nginx -s stop"
> without any error.
>
> Any way to solve the error problem?


I looked in the man page, and "start" is not a valid option for -s. The
recognized options are stop, quit, reopen, reload.

To start nginx, just use:

sudo nginx


-- Patrick

P.S. Or of course if you have /etc/init.d/nginx set up, just say:

sudo service nginx start

Or:

sudo service nginx restart
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
helloData
Re: nginx: invalid option: "-s start"
May 31, 2018 10:20PM
Hi Patrick,

Thanks. Actually, I meant "signal", by mistake I wrote "start".
I got the error "nginx: invalid option: "-s signal"

Thanks.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280005,280008#msg-280008

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Patrick Chkoreff
Re: nginx: invalid option: "-s start"
May 31, 2018 10:30PM
helloData wrote on 05/31/2018 04:10 PM:
> Hi Patrick,
>
> Thanks. Actually, I meant "signal", by mistake I wrote "start".
> I got the error "nginx: invalid option: "-s signal"

The problem is you shouldn't actually say "-s signal". The word
"signal" in the man page is just a placeholder for one of the four
options stop, quit, reopen, reload.

Here are the valid commands:

sudo nginx

# Start the server. If it's already started you'll see
# a bunch of "bind" errors. If you want to restart you
# should do a "-s quit" first.

sudo nginx -s stop

# Stop the server quickly. (Sends the SIGTERM signal.)

sudo nginx -s quit

# Stop the server gracefully. (Sends the SIGQUIT signal.)

sudo nginx -s reopen

# Reopen the server's log files but don't do anything else.

sudo nginx -s reload

# Reload the server's configuration file.
# Use this when you make changes to the configuration, but don't
# need to do a hard restart. This will gracefully shut down old
# worker processes that are using the old configuration.


-- Patrick
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login