Thin stop acts funny with Swiftiplied servers
Reported by Carl | 2008-04-20 04:42:28 UTC | in 0.8.2
This is all running under "root":
[root@domU-12-31-38-00-9D-28:/var/www/defensio.com/www] thin stop -C /etc/thin.conf
Stopping server on 127.0.0.1:30000:0 ...
Sending QUIT signal to process 1519 ...
>> Exiting!
/usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:136:in `delete': Operation not permitted - /tmp/thin.0.pid (Errno::EPERM)
from /usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:136:in `remove_pid_file'
from /usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:53:in `daemonize'
from /usr/bin/thin:19
Stopping server on 127.0.0.1:30000:1 ...
Sending QUIT signal to process 30943 ...
>> Exiting!
/usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:136:in `delete': Operation not permitted - /tmp/thin.1.pid (Errno::EPERM)
from /usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:136:in `remove_pid_file'
from /usr/lib/ruby/gems/1.8/gems/thin-0.8.1/lib/thin/daemonizing.rb:53:in `daemonize'
from /usr/bin/thin:19
Stopping server on 127.0.0.1:30000:2 ...
Sending QUIT signal to process 30967 ...
>> Exiting!
Comments and changes to this ticket
-

Carl 2008-04-20 14:18:05 UTC
I found out why it's happening. The PID files are owned by my current user instead of the user I specified in my configuration file. The user in the config file has lower privileges.
If I chown the PID files to my "web" user, Thin can stop just fine.
-

macournoyer 2008-04-20 20:06:36 UTC
- Milestone set to 0.8.2
- State changed from new to resolved
The pid file is created before changing the user and stopping doesn't change the current user.
Probably you started it the first time w/ another user.
Let me know if you think this is an issue in thin.
-

Carl 2008-04-20 23:19:11 UTC
I think it's an issue that should be fixed quite frankly. As a user, I expect "stop" to stop the servers and not give me a bunch of errors because of the internals.
You could easily change the ownership of the PID files after they're created. That'd solve the problem.
-

macournoyer 2008-04-21 10:02:43 UTC
It's the same thing as if you
sudo touch something.txtYou won't be able to
rm something.txtYou need to start and stop w/ the same user like you do w/ any web server, apache, nginx, mongrel.
And what do you mean by internals? The backtrace?
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป