I ran into a new problem today with the /run directory.  As we create it 
right now, the permissions are 755.  I was trying to run stunnel today 
and it wanted to write the stunnel.pid file after the program dropped 
root and was working as the stunnel user.  It then failed because it 
couldn't write the pid file.

There are a couple of ways to fix this.  I can, as root:

mkdir /run/stunnel
chown stunnel /run/stunnel
execute stunnel that writes the pid file to /run/stunnel

This can be set up easily enough in a boot script, but it is a little 
complex to start directly.

Alternatively, I can change the boot script that creates the /run 
directory so that the permissions are 4777. (like /tmp)

A third option is to put the pid file somewhere else where stunnel has 
write access, but that really works against the reason why the /run 
directory was created in the first place.

Of course, if stunnel is run inside a chroot, then the factors are 
different.  What I am really doing here is running Samba's swat via an 
encrypted tunnel.  In this case, running in a chroot has all sorts of 
problems in accessing the samba configuration and password files.

As a side note, it is a nice feature of stunnel that it can be run in 
server mode and yet another daemon (inetd or xinetd) is not needed.

Comments?

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to