Support | 22 Jul 2002 23:42

webmin - process module?

Hello,
 
I am wanting to build a simple module that runs a process, and types out something like "installing...."  The key to the module would be that it would state "installing..." until the program is finished.  I would like the module to "state installing" regardless of logging out of webmin and later logging back in.  In other words, "installing..."  would be typed out until the installation process is over.
 
Is a module of this sort possible?  can someone provide a some simple source code?
 
Thanks,
 
Diego
 
Joe Cooper | 23 Jul 2002 00:06

Re: webmin - process module?

When I wanted to write something like this (that downloaded and 
installed something) I stole the countdown code from Jamie's download 
routine (the one that is used during a Webmin upgrade).

You can also hold open a browser connection by sending a dot every 
second or so until the process is finished.  I.e.:

Installing...

And every second send another dot.  But this won't maintain state 
between logins!  You'll need to write out a temporary file (can be in 
the same directory as your module, or the directory where you are 
installing, or in the /tmp directory, but if there, be sure to protect 
against various race attacks that writing to a world writable directory 
can be subject to)...sort of a 'lock' file, except it indicates when the 
installation is completed.

So:

Open a file with something like `touch not-finished` (use system() for 
this, or properly open a file using the open call).

Spawn a new process to install the application.  This new process needs 
to be able to detect when the install is finished, so it can delete that 
temp file.

When the install is finished delete the temp file.

As long as the tempfile exists, show an 'Installing...' screen. 
Otherwise do whatever it is you want it to do.  If you want interactive 
users to be able to watch it installing rather than coming back 
periodically, you'll need to add a reload timeout like this:

print qq~<meta http-equiv="refresh" content=10"\n~;

If you feel fancy you could make a ticker to indicate the amount of time 
left in the install, or something similar.

Support wrote:
> Hello,
>  
> I am wanting to build a simple module that runs a process, and types out 
> something like "installing...."  The key to the module would be that it 
> would state "installing..." until the program is finished.  I would like 
> the module to "state installing" regardless of logging out of webmin and 
> later logging back in.  In other words, "installing..."  would be typed 
> out until the installation process is over.
>  
> Is a module of this sort possible?  can someone provide a some simple 
> source code?

--

-- 
Joe Cooper <joe <at> swelltech.com>
Web caching appliances and support.
http://www.swelltech.com

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Support | 26 Jul 2002 00:05

cde run priority?

Hello,
 
I am working on a module, and have noticed that
"my $results=`/usr/local/excute/fire`;"
always has priority in running in a cgi file. 
Problem here is that I would like other code to run before
"my $results=`/usr/local/excute/fire`;"
once the other code processes,

"my $results=`/usr/local/excute/fire`;" may run.  

 

My question is how do I make code run in the order I would like?

Thanks,

Diego

 

 

Jamie Cameron | 26 Jul 2002 01:49

Re: cde run priority?

Support wrote:

> Hello,
> 
>  
> 
> I am working on a module, and have noticed that
> 
> "my $results=`/usr/local/excute/fire`;"
> 
> always has priority in running in a cgi file. 
> 
> Problem here is that I would like other code to run before
> 
> "my $results=`/usr/local/excute/fire`;"
> 
> once the other code processes,
> 
> "my $results=`/usr/local/excute/fire`;" may run.  
> 
>  
> 
> My question is how do I make code run in the order I would like?

That program will only run when that line of code is reached, so
if you put the line

my $output = `/path/to/other/program`;

before it, then the other program would execute first.

  - Jamie

-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Tony Shadwick | 31 Jul 2002 00:12

Help, Usermin module coding question!

Just passing this where it should probably go. :)

Tony Shadwick
Manager of Internet Services
Strategic Technology Group

------ Forwarded Message
From: Ken Clarke <kenslinux <at> shaw.ca>
Organization: PerlProgrammer.net
Reply-To: Ken Clarke <kenslinux <at> shaw.ca>
Date: Tue, 30 Jul 2002 14:58:48 -0700
To: tshadwick <at> stgroupllc.com
Subject: Re: Help Usermin module coding question!

To clarify, I only maintain the Wish List, which as you've seen is currently
not accepting new posts.  Unfortunately, I don't have time to fix that at
the moment :(

With regard to writing modules, the best place to get questions like this
answered is on the mailing-list.

Wish I could be more help to you today.

>> Ken Clarke
>> Webmin Wish List Maintainer
>> www.webmin.com/webmin/

----- Original Message -----
From: "Tony Shadwick" <tshadwick <at> stgroupllc.com>
To: <kenslinux <at> shaw.ca>
Sent: July 30, 2002 2:40 PM
Subject: Help Usermin module coding question!

> Just got done writing the acl_security.pl for my Usermin module.  The
thing
> is, the module writing document you have on the site says for Webmin:
>
> "Module ACL options are set in the Webmin Users module by clicking on the
> name of a module next to a user's name. The options available are
generated
> by code from the module itself (except for the Can edit module
> configuration? option, which is always present). When the user clicks on
> Update the form parameters are also parsed by code from the module being
> configured, before being saved in the Webmin config directory. "
>
>
> Um..okay, that's nice.  But I need to do this for usermin.  My module
> obviously won't appear in the Webmin Users module because it's not
installed
> in Webmin, and there is no such thing as a Usermin Users module, as I
cannot
> log into Usermin as admin or root.  So...um...where on earth am I supposed
> to do this?  I can do it for each individual user from the shell, but
that's
> silly.  I'm sure it's there someplace, but I certainly don't see it! :)
>
> Thanks!
>
> Tony Shadwick
> Manager of Internet Services
> Strategic Technology Group

>
>

------ End of Forwarded Message

-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Jamie Cameron | 31 Jul 2002 03:00

Re: Help, Usermin module coding question!

The simple answer is - there is no support for acl_security.pl
detailed access control editing in usermin. Because all users are
treated the same, it doesn't really make sense ..

What kind of restrictions are you trying to configure in
your acl_security.pl file?

  - Jamie

Tony Shadwick wrote:

> Just passing this where it should probably go. :)
> 
> Tony Shadwick
> Manager of Internet Services
> Strategic Technology Group
> 
> 
> ------ Forwarded Message
> From: Ken Clarke <kenslinux <at> shaw.ca>
> Organization: PerlProgrammer.net
> Reply-To: Ken Clarke <kenslinux <at> shaw.ca>
> Date: Tue, 30 Jul 2002 14:58:48 -0700
> To: tshadwick <at> stgroupllc.com
> Subject: Re: Help Usermin module coding question!
> 
> To clarify, I only maintain the Wish List, which as you've seen is currently
> not accepting new posts.  Unfortunately, I don't have time to fix that at
> the moment :(
> 
> With regard to writing modules, the best place to get questions like this
> answered is on the mailing-list.
> 
> Wish I could be more help to you today.
> 
> 
>>>Ken Clarke
>>>Webmin Wish List Maintainer
>>>www.webmin.com/webmin/
>>>
> 
> ----- Original Message -----
> From: "Tony Shadwick" <tshadwick <at> stgroupllc.com>
> To: <kenslinux <at> shaw.ca>
> Sent: July 30, 2002 2:40 PM
> Subject: Help Usermin module coding question!
> 
> 
> 
>>Just got done writing the acl_security.pl for my Usermin module.  The
>>
> thing
> 
>>is, the module writing document you have on the site says for Webmin:
>>
>>"Module ACL options are set in the Webmin Users module by clicking on the
>>name of a module next to a user's name. The options available are
>>
> generated
> 
>>by code from the module itself (except for the Can edit module
>>configuration? option, which is always present). When the user clicks on
>>Update the form parameters are also parsed by code from the module being
>>configured, before being saved in the Webmin config directory. "
>>
>>
>>Um..okay, that's nice.  But I need to do this for usermin.  My module
>>obviously won't appear in the Webmin Users module because it's not
>>
> installed
> 
>>in Webmin, and there is no such thing as a Usermin Users module, as I
>>
> cannot
> 
>>log into Usermin as admin or root.  So...um...where on earth am I supposed
>>to do this?  I can do it for each individual user from the shell, but
>>
> that's
> 
>>silly.  I'm sure it's there someplace, but I certainly don't see it! :)
>>
>>Thanks!
>>
>>Tony Shadwick
>>Manager of Internet Services
>>Strategic Technology Group

-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Tony Shadwick | 31 Jul 2002 05:52

Re: Help, Usermin module coding question!

Well, the module I'm writing is for Spambouncer
(http://www.spambouncer.org), and right now I work at an ISP where we have
about 100 users on a single system running FreeBSD for e-mail.  They all use
POP3, and I installed Webmin and Usermin on the system for webmail.
Literally mail forwarding and read e-mail were the only things that show up
when someone logs into Usermin.

Recently, I rolled out Spambouncer as an additional pay service for a few
users to see how they handled it.  I'd been using it for about a year and it
worked wonders for me.  After about a dozen phone calls of people who
couldn't figure out how to download a text file, edit it, and upload it
again, I decided to write a Usermin control module.

I'm using the ACL to control whether a user has access or not based on
whether or not they are paying for the Spambouncer service.  I know it
sounds lame, but it  *does* eat up cpu cycles and additional disk space
(caches last 100 messages for starters) so we have to justify costs.
Besides, it wasn't my choice. :P  Anyway, the ACL fits that task perfectly.
As I said, I can manually edit files and it works, but I presumed (wrongly)
that Usermin had an equivalent control feature. :)

Any thoughts?

On 7/30/02 8:00 PM, "Jamie Cameron" <jcameron <at> webmin.com> wrote:

> The simple answer is - there is no support for acl_security.pl
> detailed access control editing in usermin. Because all users are
> treated the same, it doesn't really make sense ..
> 
> What kind of restrictions are you trying to configure in
> your acl_security.pl file?
> 
> - Jamie
> 
> Tony Shadwick wrote:
> 
>>> Just got done writing the acl_security.pl for my Usermin module.  The
>>> 
>> thing
>> 
>>> is, the module writing document you have on the site says for Webmin:
>>> 
>>> "Module ACL options are set in the Webmin Users module by clicking on the
>>> name of a module next to a user's name. The options available are
>>> 
>> generated
>> 
>>> by code from the module itself (except for the Can edit module
>>> configuration? option, which is always present). When the user clicks on
>>> Update the form parameters are also parsed by code from the module being
>>> configured, before being saved in the Webmin config directory. "
>>> 
>>> 
>>> Um..okay, that's nice.  But I need to do this for usermin.  My module
>>> obviously won't appear in the Webmin Users module because it's not
>>> 
>> installed
>> 
>>> in Webmin, and there is no such thing as a Usermin Users module, as I
>>> 
>> cannot
>> 
>>> log into Usermin as admin or root.  So...um...where on earth am I supposed
>>> to do this?  I can do it for each individual user from the shell, but
>>> 
>> that's
>> 
>>> silly.  I'm sure it's there someplace, but I certainly don't see it! :)
>>> 
>>> Thanks!

-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel

Jamie Cameron | 31 Jul 2002 07:55

Re: Help, Usermin module coding question!

If you just want to deny access to a usermin module on a per-user basis,
this will be possible in the next release of usermin (using a new feature
in the usermin configuration module in the next release of webmin). In fact,
you can try out development versions that include these features right now
from http://www.webmin.com/devel/ if you like ..

  - Jamie

Tony Shadwick wrote:

> Well, the module I'm writing is for Spambouncer
> (http://www.spambouncer.org), and right now I work at an ISP where we have
> about 100 users on a single system running FreeBSD for e-mail.  They all use
> POP3, and I installed Webmin and Usermin on the system for webmail.
> Literally mail forwarding and read e-mail were the only things that show up
> when someone logs into Usermin.
> 
> Recently, I rolled out Spambouncer as an additional pay service for a few
> users to see how they handled it.  I'd been using it for about a year and it
> worked wonders for me.  After about a dozen phone calls of people who
> couldn't figure out how to download a text file, edit it, and upload it
> again, I decided to write a Usermin control module.
> 
> I'm using the ACL to control whether a user has access or not based on
> whether or not they are paying for the Spambouncer service.  I know it
> sounds lame, but it  *does* eat up cpu cycles and additional disk space
> (caches last 100 messages for starters) so we have to justify costs.
> Besides, it wasn't my choice. :P  Anyway, the ACL fits that task perfectly.
> As I said, I can manually edit files and it works, but I presumed (wrongly)
> that Usermin had an equivalent control feature. :)
> 
> Any thoughts?
> 
> On 7/30/02 8:00 PM, "Jamie Cameron" <jcameron <at> webmin.com> wrote:
> 
> 
>>The simple answer is - there is no support for acl_security.pl
>>detailed access control editing in usermin. Because all users are
>>treated the same, it doesn't really make sense ..
>>
>>What kind of restrictions are you trying to configure in
>>your acl_security.pl file?
>>
>>- Jamie
>>
>>Tony Shadwick wrote:
>>
>>
>>>>Just got done writing the acl_security.pl for my Usermin module.  The
>>>>
>>>>
>>>thing
>>>
>>>
>>>>is, the module writing document you have on the site says for Webmin:
>>>>
>>>>"Module ACL options are set in the Webmin Users module by clicking on the
>>>>name of a module next to a user's name. The options available are
>>>>
>>>>
>>>generated
>>>
>>>
>>>>by code from the module itself (except for the Can edit module
>>>>configuration? option, which is always present). When the user clicks on
>>>>Update the form parameters are also parsed by code from the module being
>>>>configured, before being saved in the Webmin config directory. "
>>>>
>>>>
>>>>Um..okay, that's nice.  But I need to do this for usermin.  My module
>>>>obviously won't appear in the Webmin Users module because it's not
>>>>
>>>>
>>>installed
>>>
>>>
>>>>in Webmin, and there is no such thing as a Usermin Users module, as I
>>>>
>>>>
>>>cannot
>>>
>>>
>>>>log into Usermin as admin or root.  So...um...where on earth am I supposed
>>>>to do this?  I can do it for each individual user from the shell, but
>>>>
>>>>
>>>that's
>>>
>>>
>>>>silly.  I'm sure it's there someplace, but I certainly don't see it! :)
>>>>
>>>>Thanks!

-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
-
Forwarded by the Webmin development list at webmin-devel <at> webmin.com
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel


Gmane