I was playing with some setuid and camping for a project myself. I don't see if you've mentioned this, but I assume you're using the camping server to run it? I ended up just editing the camping server script to change uid and chroot just after its requires (I also edited it to do all its requires up front because I was chrooting and to just use mongrel just because). I'm not sure what the problem with doing this in the postamble would be though, are you sure it's getting run? Is it getting run every time camping reloads the script? How exactly are you setting the uid?
John On 11/03/2008, Jonathan Stott <[EMAIL PROTECTED]> wrote: > Hello Campers > > I'm not sure this is the right list to ask but: > I'm using the junebug wiki (which is written in camping) for my own personal > wiki. I'd like it to behave as a proper daemon, so it will start up at boot, > get stopped properly at shutdown, keep a pid file in /var/run etc. > > This requires a little messing with the wiki script junebug makes in the > wiki directory (changing the dirmode to system, amongst other things). > Junebug uses the daemons gem for this purpose, for those who haven't looked > at the gem. This works and I can copy the wiki script to /etc/init.d/ and > add the appropriate runlevel symlinks with update-rc.d. > > Which all works great. Except that I end with the process running as root. > Which makes me twitchy and nervous. So I'd to like to make it step down like > a good little process to a much less privileged user. I can't do this in the > /etc/init.d/ script, as it then can't write the pid file (and probably other > things). But putting it in the setup post amble doesn't seem to work (the > wiki is still root) > > So where should my Process.uid statements go? > > Regards, > Jon. > _______________________________________________ > Camping-list mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/camping-list > _______________________________________________ Camping-list mailing list [email protected] http://rubyforge.org/mailman/listinfo/camping-list

