PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Shell Script from Web
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Shell Script from Web

Réponse
 
LinkBack Outils de la discussion
Vieux 02/01/2008, 13h24   #1
Saurabh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Shell Script from Web

Hi,

Background:
=======
I am running a shell script from my perl script (web page). Shell
script creates a file database.sql which then I use to create database
and table structure.

Code
====
Perl
-----
my @output = system("install_my_profile.sh <parameters>");

Shell Script [install_my_profile.sh]
--------------
echo -e $mysql>database.sql

this gives error permission denied, I have changed directory ownership
to apache:apache

Please

Regards
Saurabh
  Réponse avec citation
Vieux 02/01/2008, 13h55   #2
Burkhard Ott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Shell Script from Web

Am Wed, 02 Jan 2008 05:24:10 -0800 schrieb Saurabh:

> Hi,


Hello,

> Shell Script [install_my_profile.sh]
> --------------
> echo -e $mysql>database.sql
>
> this gives error permission denied, I have changed directory ownership
> to apache:apache


Permission denied comes afaik from you database, you will the apache user
in your database.
  Réponse avec citation
Vieux 02/01/2008, 14h20   #3
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Shell Script from Web

Saurabh wrote:
>
> Background:
> =======
> I am running a shell script from my perl script (web page). Shell
> script creates a file database.sql which then I use to create database
> and table structure.
>
> Code
> ====
> Perl
> -----
> my @output = system("install_my_profile.sh <parameters>");
>


To debug add to your script:

> Shell Script [install_my_profile.sh]
> --------------


pwd
echo "$mysql"
set -x
> echo -e $mysql>database.sql

set +x

> this gives error permission denied, I have changed directory ownership
> to apache:apache


--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
  Réponse avec citation
Vieux 03/01/2008, 11h06   #4
Saurabh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Shell Script from Web

@ Burkhard Ott : Thanks, but there Im just trying to write an file
with extention .sql so it cant be a issue of MySQL rights.

@Cyrus Kriticos : Thanks, I took the decision to go other way, instead
of writing the sql file where I was putting commands to create
database and grant privileges and then running it in shell script. Now
Iam not creating that file instead I do this

mysqladmin -usuper -pduper create $profile [this creates database for
profile]
mysql -usuper -pduper -e "grant all on $profile.* to root@localhost
identified by 'duper'" [this grants privileges]

Thanks again,
Saurabh

On Jan 2, 7:20 pm, Cyrus Kriticos <cyrus.kriti...@googlemail.com>
wrote:
> Saurabh wrote:
>
> > Background:
> > =======
> > I am running a shell script from my perl script (web page). Shell
> > script creates a file database.sql which then I use to create database
> > and table structure.

>
> > Code
> > ====
> > Perl
> > -----
> > my @output = system("install_my_profile.sh <parameters>");

>
> To debug add to your script:
>
> > Shell Script [install_my_profile.sh]
> > --------------

>
> pwd
> echo "$mysql"
> set -x> echo -e $mysql>database.sql
>
> set +x
>
> > this gives error permission denied, I have changed directory ownership
> > to apache:apache

>
> --
> Best regards | Be nice to America or they'll bring democracy to
> Cyrus | your country.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h29.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13781 seconds with 12 queries