I installed nginx on my mac lion by using homebrew. When i type command:
nginx -s stop
the service is launched again in a second. how can i stop it?
If you installed the LaunchAgent, I believe that will keep the service alive if it's not running.
You can try running launchctl stop org.nginx.nginx or remove the
<key>KeeyAlive</key>
<true/>
bit from the plist (~/Library/LaunchAgents/org.nginx.nginx.plist)
Update
Looks like the only way to stop the daemon is to unload the LaunchAgent:
launchctl unload ~/Library/LaunchAgents/org.nginx.nginx.plist