Hi,

Do you mean creating it on start?

There is an open bug in the Debian bugtracker about this:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616712


Two years ago I said "yes, Wt should create it":

http://www.mail-archive.com/witty-interest@lists.sourceforge.net/msg02065.html

But when I started to write the doc I promised in the Debian
bugtracker, I realized there are several cases and subcases here. This
is more or less what I have written, but I'm not satisfied with the
solution to case 2. Please comment :-)

---8<-------------------
Let's start with some facts:
- the Wt webapp needs to be launched somehow
- in the general case (production), it will be started automatically


Case 1: wthttp webapp
=================

I can think of three different subcases here:


1.1 WtHttp webapp started by init script
---------------------------------------------------

In this case, IMHO it should be the init script the one to create the
/var/run/wt directory and any other directories required by the
application outside approot, including setting the appropriate
permissions. Given that init scripts run with root permissions, this
should not be a problem.


1.2 WtHttp webapp started by inetd
----------------------------------------------

Inetd starts services on demand.

This case can be assimilated to either 1.1 or 2, depending on what we
tell inetd to do:

- If we tell inetd to run a script that creates /var/run/wt and any
other directories required by the application, then this case is the
same as 1.1. Should the script needs to create /var/run/wt and/or
files or directories which require permissions other than those of the
www-data user, then we must tell inetd to run the script as root, then
change permissions (with su, for instance).

- If we tell inetd to run webapp.wt directly, then this is like case 2

1.3 HTTP server forwarding to WtHttp webapp
------------------------------------------------------------

This is like case 2



Case 2: wtfcgi webapp
=================

In this case, there is no init script: the app is run directly by the
HTTP server. And frankly, I cannot think of a good solution:
- The directory cannot be created by the the Wt webapp. It will fail
because /var/run requires root permissions.
- AFAIK, there is no way to tell the HTTP server: "hey, before
forwarding a connection to my FCGI module, please create this
directory/file". Even if there was, we hit the permissions problem
again: that mkdir would run as www-data, not as root.

The only solution I see is, again, an init script. The init script
should be run before or at the same runlevel as the HTTP server to
avoid race conditions.
---8<-------------------


On Thu, Sep 1, 2011 at 11:02 AM, Wim Dumon <w...@emweb.be> wrote:
> Pau,
>
> Should Wt try to create it's run directory if it does not exist,
> according to the Linux Standard Base specification? If so, with what
> permissions?
>
> BR,
> Wim.
>
> 2011/9/1 Pau Garcia i Quiles <pgqui...@elpauer.org>:
>> Hi,
>>
>> /var/run (in modern distributions, /run) is removed on reboot, as the
>> Linux Standard Base specification says. That's expected.
>>
>> Now, what I do not understand, is why the OP is writing files to
>> /usr/wt/run. To persist them? If that's the case, then the proper
>> solution is to either persist the information in the database
>> (including blobs), or to write to some other directory. Wt uses the
>> usual C++ I/O features, and the directory to use to persist the
>> information/files/uploads/whatever can be either hard-coded, or
>> specified in wt_config.xml
>>
>> Or maybe the OP wants to do something completely different that I
>> don't understand?
>>
>>
>>
>>
>> On Thu, Sep 1, 2011 at 1:10 AM,  <jwmier...@aol.com> wrote:
>>>>  /usr/wt/run
>>> This is a hack, not a solution.
>>> Anyone knows a solution?
>>>
>>>
>>>
>>> On 08/31/2011 08:08 AM, PARVINDER RAJPUT wrote:
>>>> On Wed, Aug 31, 2011 at 6:32 PM, Mohammed Rashad
>>>> <mohammedrasha...@gmail.com> wrote:
>>>>> you can change run directory in /etc/wt/wt_config.xml
>>>>> <run-directory>/var/run/wt</run-directory>
>>>>> change it to
>>>>> <run-directory>/usr/wt/run</run-directory>
>>>>> and also create a dir run in /usr/wt
>>>>> and give its ownership to www-data
>>>> Thanks i will try
>>>> Parvinder Rajput
>>>> website:- www.parvinder.co.in
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Special Offer -- Download ArcSight Logger for FREE!
>>>> Finally, a world-class log management solution at an even better
>>>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>>>> download Logger. Secure your free ArcSight Logger TODAY!
>>>> http://p.sf.net/sfu/arcsisghtdev2dev
>>>> _______________________________________________
>>>> witty-interest mailing list
>>>> witty-interest@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>
>>> ------------------------------------------------------------------------------
>>> Special Offer -- Download ArcSight Logger for FREE!
>>> Finally, a world-class log management solution at an even better
>>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>>> download Logger. Secure your free ArcSight Logger TODAY!
>>> http://p.sf.net/sfu/arcsisghtdev2dev
>>> _______________________________________________
>>> witty-interest mailing list
>>> witty-interest@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>
>>
>>
>>
>> --
>> Pau Garcia i Quiles
>> http://www.elpauer.org
>> (Due to my workload, I may need 10 days to answer)
>>
>> ------------------------------------------------------------------------------
>> Special Offer -- Download ArcSight Logger for FREE!
>> Finally, a world-class log management solution at an even better
>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>> download Logger. Secure your free ArcSight Logger TODAY!
>> http://p.sf.net/sfu/arcsisghtdev2dev
>> _______________________________________________
>> witty-interest mailing list
>> witty-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to