KerwinMa / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

move save_pid before setuid may better #362

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. /usr/bin/memcached -p 11211 -d -P /var/run/memcached.pid -u nobody
2. ls /var/run/memcached.pid ## error

What is the expected output? What do you see instead?
pidfile was not created for Permission denied, pidfile should be written before 
setuid

What version of the product are you using? On what operating system?
v1.4.18 on centos 6.4

Original issue reported on code.google.com by iamzheng...@gmail.com on 22 Apr 2014 at 8:13

GoogleCodeExporter commented 9 years ago
There're a handful of things open for this...

What we really need to do is to keep some parent/child communications open 
during fork and bubble errors to the parent before letting it die. There're a 
few error conditions where flipping the order just makes different failures 
invisible.

Original comment by dorma...@rydia.net on 22 Apr 2014 at 8:16