Re: [vdr] Quota and VDR (1.6.0)

2008-04-14 Thread Klaus Schmidinger
On 04/14/08 00:26, Manfred Schmidt-Voigt wrote:
 Klaus Schmidinger schrieb:
 On 03/23/08 10:46, Manfred Schmidt-Voigt wrote:
 Manfred Schmidt-Voigt schrieb:
 Hello List,

 I have a diskless VDR machine in my livingroom (so its very quit). 
 My /video is mounted by nfs from a Servermachine under the roof. On 
 that server I have set a groupquota for that /video directory to 
 save some place for other applikations on that filesystem (raid 5 - 
 4x400G).
 ...
 But the VDR Software doesn't recognize that. It does not start to 
 mark old recording for removing. In the menu overview it show still 
 some hours free space util the end of the complete filesystem.

 Now my question: Do I have to configure something special in VDR 
 that it recognizes the Quota setting of that directory or have I to 
 use userquota for the user of VDR (in my case it is root but if it 
 is the only solution I could change it to a regular user, but only 
 if it helps for my problem)?
...
 No, VDR is not able to follow Quota. It is looking only for the 
 standard size parameters of the filesystem... ;-(

 So I had to help myself. The outcome is a patch/hack for my current 
 VDR Version 1.4.5. But it should be easy to apopt it also to newer 
 versions.  I have glued it together out of several GOOGLE sniplets. 
 Maybe somebody can look over this patch who has more ability to code 
 this according real C++ styles. I'm not used to progamm in C++. But 
 for this little patch it was sufficient.
...
 Sorry, but this is really too much to change for implementing quota 
 handling.
 ...
 I have changed the patch a little bit because there was a logical fault 
 in it. But now it's for vdr-1.6.0. I have not tested the xfs part 
 because currently I use only ext3 or nfs. So this should be tested maybe 
 by somebody else or if you would like to implement such a logic into vdr 
 leave it out or comment it out or do it your own way. The problem here 
 is that by each kind of check of the different filesystems you receive 
 different numberunits of something what is called a block. It seems so 
 that all the people, which implements  the quotalogic for the different 
 filesystems, had a different thought what a block should look like...
 
 Manfred

I'll probably make a plugin interface for this. Then you can implement this
outside of the core VDR code.

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Quota and VDR (1.6.0)

2008-04-14 Thread Manfred Schmidt-Voigt
Klaus Schmidinger schrieb:
 On 04/14/08 00:26, Manfred Schmidt-Voigt wrote:
 Klaus Schmidinger schrieb:
 On 03/23/08 10:46, Manfred Schmidt-Voigt wrote:
 Manfred Schmidt-Voigt schrieb:
 Hello List,

 I have a diskless VDR machine in my livingroom (so its very quit). 
 My /video is mounted by nfs from a Servermachine under the roof. On 
 that server I have set a groupquota for that /video directory to 
 save some place for other applikations on that filesystem (raid 5 - 
 4x400G).
 ...
 But the VDR Software doesn't recognize that. It does not start to 
 mark old recording for removing. In the menu overview it show still 
 some hours free space util the end of the complete filesystem.

 Now my question: Do I have to configure something special in VDR 
 that it recognizes the Quota setting of that directory or have I to 
 use userquota for the user of VDR (in my case it is root but if it 
 is the only solution I could change it to a regular user, but only 
 if it helps for my problem)?
 ...
 No, VDR is not able to follow Quota. It is looking only for the 
 standard size parameters of the filesystem... ;-(

 So I had to help myself. The outcome is a patch/hack for my current 
 VDR Version 1.4.5. But it should be easy to apopt it also to newer 
 versions.  I have glued it together out of several GOOGLE sniplets. 
 Maybe somebody can look over this patch who has more ability to code 
 this according real C++ styles. I'm not used to progamm in C++. But 
 for this little patch it was sufficient.
 ...
 Sorry, but this is really too much to change for implementing quota 
 handling.
 ...
 I have changed the patch a little bit because there was a logical fault 
 in it. But now it's for vdr-1.6.0. I have not tested the xfs part 
 because currently I use only ext3 or nfs. So this should be tested maybe 
 by somebody else or if you would like to implement such a logic into vdr 
 leave it out or comment it out or do it your own way. The problem here 
 is that by each kind of check of the different filesystems you receive 
 different numberunits of something what is called a block. It seems so 
 that all the people, which implements  the quotalogic for the different 
 filesystems, had a different thought what a block should look like...

 Manfred
 
 I'll probably make a plugin interface for this. Then you can implement this
 outside of the core VDR code.
 
 Klaus
 
...

That sounds good and I can improve a little bit my C(++) knowledge...

Thanks
Manfred

-- 
---   Manfred Schmidt-Voigt  ---
-www.mannitec.de   -
---  mailto:[EMAIL PROTECTED]---

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Quota and VDR

2008-04-13 Thread Klaus Schmidinger
On 03/23/08 10:46, Manfred Schmidt-Voigt wrote:
 Manfred Schmidt-Voigt schrieb:
 Hello List,

 I have a diskless VDR machine in my livingroom (so its very quit). My 
 /video is mounted by nfs from a Servermachine under the roof. On that 
 server I have set a groupquota for that /video directory to save some 
 place for other applikations on that filesystem (raid 5 - 4x400G).

 I have exeeded now the space on that filesystem for that group and in 
 the syslog of the VDR I can see related messages.

 Example:
 Mar  9 08:52:32 stereo vdr: [4167] switching device 1 to channel 1
 Mar  9 08:52:32 stereo vdr: [4167] timer 18 (1 0852-1152 '@TITLE 
 EPISODE') start
 Mar  9 08:52:32 stereo vdr: [4167] Title: 'Tigerenten Club' Subtitle: 
 'Der Club zum Mitmachen'
 Mar  9 08:52:32 stereo vdr: [4167] record 
 /video/@Tigerenten_Club_Der_Club_zum_Mitmachen/2008-03-09.08.52.50.99.rec
 Mar  9 08:52:32 stereo vdr: [4167] creating directory 
 /video/@Tigerenten_Club_Der_Club_zum_Mitmachen
 Mar  9 08:52:32 stereo vdr: [4167] ERROR: 
 /video/@Tigerenten_Club_Der_Club_zum_Mitmachen: Disk quota exceeded


 But the VDR Software doesn't recognize that. It does not start to mark 
 old recording for removing. In the menu overview it show still some 
 hours free space util the end of the complete filesystem.

 Now my question: Do I have to configure something special in VDR that 
 it recognizes the Quota setting of that directory or have I to use 
 userquota for the user of VDR (in my case it is root but if it is the 
 only solution I could change it to a regular user, but only if it 
 helps for my problem)?

 Some revision data:
 VDR 1.4.5 ( yes, I'm waiting for 1.6 )
 Debian Etch on both VDR and Server


 Thank you
 Manfred


 
 Hi List,
 
 because nobody answers me I have to answer myself:
 
 No, VDR is not able to follow Quota. It is looking only for the standard 
 size parameters of the filesystem... ;-(
 
 So I had to help myself. The outcome is a patch/hack for my current VDR 
 Version 1.4.5. But it should be easy to apopt it also to newer versions. 
  I have glued it together out of several GOOGLE sniplets. Maybe somebody 
 can look over this patch who has more ability to code this according 
 real C++ styles. I'm not used to progamm in C++. But for this little 
 patch it was sufficient.
 
 To use this you have to install the quota package on your server and 
 maybe the quota-utils on your client. For your convenience I have 
 included already the rquota-files into this patch. (I hope its according 
 to any licenses)
 
 Have fun
 Manfred

Sorry, but this is really too much to change for implementing quota handling.
Besides, if an application actually needs to do this much to follow system
quotas, doesn't this mean that apps that just don't care about quotas can
do whatever they want?

Shouldn't the presence of quotas mean that *every* application sees only
parameters that fit the current quota, without even knowing that it has
been limited?

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Quota and VDR (1.6.0)

2008-04-13 Thread Manfred Schmidt-Voigt

Klaus Schmidinger schrieb:

On 03/23/08 10:46, Manfred Schmidt-Voigt wrote:

Manfred Schmidt-Voigt schrieb:

Hello List,

I have a diskless VDR machine in my livingroom (so its very quit). My 
/video is mounted by nfs from a Servermachine under the roof. On that 
server I have set a groupquota for that /video directory to save some 
place for other applikations on that filesystem (raid 5 - 4x400G).


I have exeeded now the space on that filesystem for that group and in 
the syslog of the VDR I can see related messages.


Example:
Mar  9 08:52:32 stereo vdr: [4167] switching device 1 to channel 1
Mar  9 08:52:32 stereo vdr: [4167] timer 18 (1 0852-1152 '@TITLE 
EPISODE') start
Mar  9 08:52:32 stereo vdr: [4167] Title: 'Tigerenten Club' Subtitle: 
'Der Club zum Mitmachen'
Mar  9 08:52:32 stereo vdr: [4167] record 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen/2008-03-09.08.52.50.99.rec
Mar  9 08:52:32 stereo vdr: [4167] creating directory 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen
Mar  9 08:52:32 stereo vdr: [4167] ERROR: 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen: Disk quota exceeded



But the VDR Software doesn't recognize that. It does not start to mark 
old recording for removing. In the menu overview it show still some 
hours free space util the end of the complete filesystem.


Now my question: Do I have to configure something special in VDR that 
it recognizes the Quota setting of that directory or have I to use 
userquota for the user of VDR (in my case it is root but if it is the 
only solution I could change it to a regular user, but only if it 
helps for my problem)?


Some revision data:
VDR 1.4.5 ( yes, I'm waiting for 1.6 )
Debian Etch on both VDR and Server


Thank you
Manfred



Hi List,

because nobody answers me I have to answer myself:

No, VDR is not able to follow Quota. It is looking only for the standard 
size parameters of the filesystem... ;-(


So I had to help myself. The outcome is a patch/hack for my current VDR 
Version 1.4.5. But it should be easy to apopt it also to newer versions. 
 I have glued it together out of several GOOGLE sniplets. Maybe somebody 
can look over this patch who has more ability to code this according 
real C++ styles. I'm not used to progamm in C++. But for this little 
patch it was sufficient.


To use this you have to install the quota package on your server and 
maybe the quota-utils on your client. For your convenience I have 
included already the rquota-files into this patch. (I hope its according 
to any licenses)


Have fun
Manfred


Sorry, but this is really too much to change for implementing quota handling.
Besides, if an application actually needs to do this much to follow system
quotas, doesn't this mean that apps that just don't care about quotas can
do whatever they want?

Shouldn't the presence of quotas mean that *every* application sees only
parameters that fit the current quota, without even knowing that it has
been limited?

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



Applications, which do not care about quota, can not really do what they 
want, they only can not write to the filesystem if the quotalimit is 
reached. Thats what quota is made for. But if you would like to react on 
such a limit in a more intelligent way you have to ask for that limit 
and not only for the simple filesystem limit. statfs(..) only delivers 
the 'physical' limits of the filesystem. So vdr could not make new 
recordings when the limit is reached because it checks for the 
filesystemlimit. This value shows vdr to have enough space. So it never 
starts to delete old recordings.


I have changed the patch a little bit because there was a logical fault 
in it. But now it's for vdr-1.6.0. I have not tested the xfs part 
because currently I use only ext3 or nfs. So this should be tested maybe 
by somebody else or if you would like to implement such a logic into vdr 
leave it out or comment it out or do it your own way. The problem here 
is that by each kind of check of the different filesystems you receive 
different numberunits of something what is called a block. It seems so 
that all the people, which implements  the quotalogic for the different 
filesystems, had a different thought what a block should look like...


Manfred

--
---   Manfred Schmidt-Voigt  ---
-www.mannitec.de   -
---  mailto:[EMAIL PROTECTED]---
diff -Naur vdr-1.6.0_orig/Makefile vdr-1.6.0/Makefile
--- vdr-1.6.0_orig/Makefile	2008-02-29 22:43:03.0 +0100
+++ vdr-1.6.0/Makefile	2008-04-13 23:52:12.0 +0200
@@ -41,7 +41,7 @@
lirc.o menu.o menuitems.o nit.o osdbase.o osd.o pat.o player.o plugin.o rcu.o\
receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o shutdown.o\
skinclassic.o skins.o skinsttng.o 

Re: [vdr] Quota and VDR

2008-03-23 Thread Manfred Schmidt-Voigt

Manfred Schmidt-Voigt schrieb:

Hello List,

I have a diskless VDR machine in my livingroom (so its very quit). My 
/video is mounted by nfs from a Servermachine under the roof. On that 
server I have set a groupquota for that /video directory to save some 
place for other applikations on that filesystem (raid 5 - 4x400G).


I have exeeded now the space on that filesystem for that group and in 
the syslog of the VDR I can see related messages.


Example:
Mar  9 08:52:32 stereo vdr: [4167] switching device 1 to channel 1
Mar  9 08:52:32 stereo vdr: [4167] timer 18 (1 0852-1152 '@TITLE 
EPISODE') start
Mar  9 08:52:32 stereo vdr: [4167] Title: 'Tigerenten Club' Subtitle: 
'Der Club zum Mitmachen'
Mar  9 08:52:32 stereo vdr: [4167] record 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen/2008-03-09.08.52.50.99.rec
Mar  9 08:52:32 stereo vdr: [4167] creating directory 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen
Mar  9 08:52:32 stereo vdr: [4167] ERROR: 
/video/@Tigerenten_Club_Der_Club_zum_Mitmachen: Disk quota exceeded



But the VDR Software doesn't recognize that. It does not start to mark 
old recording for removing. In the menu overview it show still some 
hours free space util the end of the complete filesystem.


Now my question: Do I have to configure something special in VDR that it 
recognizes the Quota setting of that directory or have I to use 
userquota for the user of VDR (in my case it is root but if it is the 
only solution I could change it to a regular user, but only if it helps 
for my problem)?


Some revision data:
VDR 1.4.5 ( yes, I'm waiting for 1.6 )
Debian Etch on both VDR and Server


Thank you
Manfred




Hi List,

because nobody answers me I have to answer myself:

No, VDR is not able to follow Quota. It is looking only for the standard 
size parameters of the filesystem... ;-(


So I had to help myself. The outcome is a patch/hack for my current VDR 
Version 1.4.5. But it should be easy to apopt it also to newer versions. 
 I have glued it together out of several GOOGLE sniplets. Maybe 
somebody can look over this patch who has more ability to code this 
according real C++ styles. I'm not used to progamm in C++. But for this 
little patch it was sufficient.


To use this you have to install the quota package on your server and 
maybe the quota-utils on your client. For your convenience I have 
included already the rquota-files into this patch. (I hope its according 
to any licenses)


Have fun
Manfred

--
---   Manfred Schmidt-Voigt  ---
-www.mannitec.de   -
---  mailto:[EMAIL PROTECTED]---
diff -Naur vdr-1.4.5_orig/Makefile vdr-1.4.5/Makefile
--- vdr-1.4.5_orig/Makefile	2006-08-20 12:44:22.0 +0200
+++ vdr-1.4.5/Makefile	2008-03-23 09:32:25.0 +0100
@@ -37,7 +37,7 @@
lirc.o menu.o menuitems.o nit.o osdbase.o osd.o pat.o player.o plugin.o rcu.o\
receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o\
skinclassic.o skins.o skinsttng.o sources.o spu.o status.o svdrp.o themes.o thread.o\
-   timers.o tools.o transfer.o vdr.o videodir.o
+   timers.o tools.o transfer.o vdr.o videodir.o rquota_xdr.o
 
 FIXFONT_ISO8859_1 = -adobe-courier-bold-r-normal--25-*-100-100-m-*-iso8859-1
 OSDFONT_ISO8859_1 = -adobe-helvetica-medium-r-normal--23-*-100-100-p-*-iso8859-1
diff -Naur vdr-1.4.5_orig/rquota.h vdr-1.4.5/rquota.h
--- vdr-1.4.5_orig/rquota.h	1970-01-01 01:00:00.0 +0100
+++ vdr-1.4.5/rquota.h	2008-03-23 09:31:01.0 +0100
@@ -0,0 +1,185 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _RQUOTA_H_RPCGEN
+#define _RQUOTA_H_RPCGEN
+
+#include rpc/rpc.h
+
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+#define RQ_PATHLEN 1024
+
+struct sq_dqblk {
+	u_int rq_bhardlimit;
+	u_int rq_bsoftlimit;
+	u_int rq_curblocks;
+	u_int rq_fhardlimit;
+	u_int rq_fsoftlimit;
+	u_int rq_curfiles;
+	u_int rq_btimeleft;
+	u_int rq_ftimeleft;
+};
+typedef struct sq_dqblk sq_dqblk;
+
+struct getquota_args {
+	char *gqa_pathp;
+	int gqa_uid;
+};
+typedef struct getquota_args getquota_args;
+
+struct setquota_args {
+	int sqa_qcmd;
+	char *sqa_pathp;
+	int sqa_id;
+	sq_dqblk sqa_dqblk;
+};
+typedef struct setquota_args setquota_args;
+
+struct ext_getquota_args {
+	char *gqa_pathp;
+	int gqa_type;
+	int gqa_id;
+};
+typedef struct ext_getquota_args ext_getquota_args;
+
+struct ext_setquota_args {
+	int sqa_qcmd;
+	char *sqa_pathp;
+	int sqa_id;
+	int sqa_type;
+	sq_dqblk sqa_dqblk;
+};
+typedef struct ext_setquota_args ext_setquota_args;
+
+struct rquota {
+	int rq_bsize;
+	bool_t rq_active;
+	u_int rq_bhardlimit;
+	u_int rq_bsoftlimit;
+	u_int rq_curblocks;
+	u_int rq_fhardlimit;
+	u_int rq_fsoftlimit;
+	u_int rq_curfiles;
+	u_int rq_btimeleft;
+	u_int rq_ftimeleft;
+};
+typedef struct rquota rquota;
+
+enum qr_status {
+	Q_OK = 1,
+	Q_NOQUOTA = 2,
+	Q_EPERM = 3,
+};
+typedef