Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Can perl do this ?, Can perl do this ?< Next Oldest | Next Newest >
manishsadh Offline

Group: Members
Posts: 42
Joined: Jan. 2007
Posted: Mar. 05 2007,10:04 QUOTE

Hi Folks,

i was wondering if perl scripting can help me do these things
on the monkey web server.

1 - create cron jobs and store them in crontab with root privileges

2 - create shell scripts and run them with with root privileges

3- run other shell commands and deamon's with root privileges

Back to top
Profile PM 
WDef Offline

Group: Members
Posts: 798
Joined: Sep. 2005
Posted: Mar. 05 2007,15:08 QUOTE

Not sure what you mean by "on" the Monkey web server.  Are you talking about wriiting applets or something to do these things from a secure remote web interface?
Back to top
Profile PM 
mikshaw Offline

Group: Members
Posts: 4856
Joined: July 2004
Posted: Mar. 05 2007,15:32 QUOTE

Theoretically, any task that can be done on the local machine can be done through a webserver on that same machine. If a Perl script can be written to create a cron job locally (which it can), then you could write a perl cgi script to do the same through a webserver on that machine.
An exception is if the server changes its filesystem root (chroot) when it runs, in order to limit remote access to sensitive files.
As far as tasks that require root, I think you are probably going to have problems. The webserver is typically run as a very limited user (nobody) to prevent unwanted access to system files. Giving this user permission to run as root basically destroys the whole concept of running as a limited user.  If you just want to have personal access to a remote machine through a browser, you *could* run the server as root, but I strongly recommend that you lock down the server to allow no unauthorized access (specifically, no access at all other than you).

Back to top
Profile PM WEB 
Felson Offline

Group: Members
Posts: 54
Joined: Jan. 2007
Posted: Mar. 11 2007,21:54 QUOTE

There is an alternative.... Since you can't really make perl run stuf as root, you can make it write to a file that a cron job checks every minute or so.
So, the idea is, you make a root run cron that check to see if a file exists, if it does, do some action, and delete the file, if it doesn't, do nothing. Then you make a script that writes the file to the needed location.
ya, you have a useless cron running 99.99% of the time, but checking to see if a file exists isn't that expensive really.
Back to top
Profile PM 
3 replies since Mar. 05 2007,10:04 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Quick Reply: Can perl do this ?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code