On 08/11/2005, at 5:25 AM, Peter Berry wrote:

> I've been busy building an RPM for Fedora Core 3 of 0.10.2, patching 
> the wrapper script to use twistd to invoke the daemon. Now the init 
> script I wrote for this used to use 'killproc PyMSNt' to stop the 
> daemon, but now that twistd is used, the process is actually called 
> twistd. So '/etc/init.d/pymsnt stop' no longer manages to kill PyMSNt.
>
> Now as far as I can tell, using 'killproc twistd' in the init script 
> will not work since that won't find the pid file in 
> /usr/lib/jabber/msn (even if I call it twistd.pid), and even if it did 
> it would not be a good idea since twistd might be running several 
> daemons.
>
> One possible solution to this is to put the pid file in /var/run 
> instead of /usr/lib/jabber/msn (where it is atm) so that the pidofproc 
> function will find it. Unfortunately the jabber user doesn't have 
> write permission there, so 'su jabber -c "/usr/lib/jabber/msn/PyMSNt"' 
> doesn't work.
>
> Is it possible to invoke twistd as root, and have it change its uid 
> and gid to jabber once it has created the pid file? Or is there some 
> better way of solving the problem that my tiny brain has failed to 
> realize?
>
> -- 
> Peter Berry, SUCS Ex-Treasurer
> <[EMAIL PROTECTED]>

Grab the tarball and do
svn switch svn://delx.cjb.net/pymsnt/branches/0_10_x

There's two new options in PyMSNt.tac concerning privilege shedding 
that should interest you.
Twistd is quite cool :)

---

James

Reply via email to