[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-developers] System Script via UI
- Subject: RE: [cobalt-developers] System Script via UI
- From: "Robert Walter" <rwalter@xxxxxxxxx>
- Date: Wed Aug 21 11:19:01 2002
- Organization: Cyrius Automation Inc.
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
Alan,
Although the sausalito architecture has a fork command for doing exactly
what you want, I have found that getting things done is tough. It seems
to not have very much in terms of root level permissions due to the
process running as admin. I have only found one instance in Sun Cobalts
programming where they have used this fork command. And I have never
gotten it to work right.
I have found it much easier to create a schema and event, that when
triggered, runs your perl script. All events are run from a root level
process which gives you the root level permissions required to run the
perl script. This is the way the Sun Cobalt programmers do things.
You will need to learn how to implement CCE (Not easy, but not
impossible) to do the schema /event model. Look at some of the Sun
Coblat code for examples.
Robert Walter
rwalter@xxxxxxxxx
Cyrius Automation Inc.
78 - 678 Citadel Drive
Port Coquitlam, BC
V3C6M7 CANADA
-----Original Message-----
From: cobalt-developers-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-developers-admin@xxxxxxxxxxxxxxx] On Behalf Of Alan J
Sonnenberg
Sent: Tuesday, August 20, 2002 5:54 AM
To: cobalt-developers@xxxxxxxxxxxxxxx
Subject: [cobalt-developers] System Script via UI
hello-
Anyone have any insight to running "system scripts" from the Cobalt UI
on a RAQ 550. Assumed it would be fairly straight forward looking at
some php files provided with the system, but I am clearly missing
something.
I have included two small files as the example:
alan.php . Simple php file that should fork script
alan.pl . Simple script located in /usr/sausalito/sbin
The script runs when started from the shell prompt and touches file.
When I use the UI to bring up the page alan.php, it loads, but the
script never runs (that I can tell). I have tried passing the user
"root" to the fork() also. Any ideas will be greatly appreciated.
Thanks
Alan
------------- alan.php------------------
<?php
include("ServerScriptHelper.php");
$helper = new ServerScriptHelper();
$cmd = "/usr/sausalito/sbin/alan.pl";
$stat = $helper->fork($cmd, "httpd");
// Nothing in stat??.... Not sure where to pick up error, possible in
helper->errors
$helper->destructor();
?>
-------------- /usr/sausalito/sbin/alan.pl ----------------
#!/usr/bin/perl -I/usr/sausalito/perl
#
use strict;
# sane umask
umask(002);
system("/bin/touch /tmp/alan");
_______________________________________________
cobalt-developers mailing list cobalt-developers@xxxxxxxxxxxxxxx
http://list.cobalt.com/mailman/listinfo/cobalt-developers