Sponsored Content
Full Discussion: Problem on running a script
Top Forums Shell Programming and Scripting Problem on running a script Post 302661011 by satimis on Sunday 24th of June 2012 10:46:52 AM
Old 06-24-2012
Problem on running a script

Hi all,

Running follow command on terminal;

Code:
$ glance -T cloudlive -I ubuntu -K ubuntu123 -N \
http://127.0.0.1:5000/v2.0/OpenX add name="cirros" is_public=true \
container_format=ovf disk_format=raw < \
/srv/cirros-0.3.0-x86_64-disk.img

It works without problem.

Putting it on a script file together with other commands, it doesn't work properly

performed following steps on terminal:-
Code:
$ sudo mount /dev/sda /mnt
$ nano /mnt/script.sh
nova-setup.sh

start-openstack.sh

glance -T cloudlive -I ubuntu -K ubuntu123 -N http://127.0.0.1:5000/v2.0/ add name="cirros" is_public=true container_format=ovf disk_format=raw < /srv/cirros-0.3.0-x86_64-disk.img    # one line

wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img

glance -T cloudlive -I ubuntu -K ubuntu123 -N http://127.0.0.1:5000/v2.0/ add name="precise-server-amd64" is_public="true" disk_format=raw container_format=ovf < precise-server-cloudimg-amd64-disk1.img   # one line

exit 0


Code:
$ sudo chmod +x /mnt/script.sh
$ /mnt/script.sh
......
......
Failed to connect to the Glance API server 0.0.0.0:9292. Is the server running?
--2012-06-22 15:17:09-- http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
    Resolving uec-images.ubuntu.com (uec-images.ubuntu.com)... 91.189.88.140
    Connecting to uec-images.ubuntu.com (uec-images.ubuntu.com)|91.189.88.140|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 230621184 (220M) [application/octet-stream]
    Saving to: `precise-server-cloudimg-amd64-disk1.img'

Finally I have to create 2 scripts

script01:
Code:
nova-setup.sh
start-openstack.sh

script02:
Code:
glance -T cloudlive -I ubuntu -K ubuntu123 -N http://127.0.0.1:5000/v2.0/ add name="cirros" is_public=true container_format=ovf disk_format=raw < /srv/cirros-0.3.0-x86_64-disk.img    # one line

wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img

glance -T cloudlive -I ubuntu -K ubuntu123 -N http://127.0.0.1:5000/v2.0/ add name="precise-server-amd64" is_public="true" disk_format=raw container_format=ovf < precise-server-cloudimg-amd64-disk1.img   # one line

Run them one by one. Them it works without complaint.

Pls help me to understand why they can't be in one script? Is there any solution? TIA

B.R.
satimis

Last edited by Scrutinizer; 06-24-2012 at 01:30 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Problem running script remotelly.

Hi, i would like a help with this problem. i have the following situation: 4 workstations SUNs: SunOS porsche 5.8 Generic_117350-18 sun4u sparc SUNW,Sun-Blade-100 SunOS jaguar 5.8 Generic_108528-18 sun4u sparc SUNW,Sun-Blade-100 SunOS mercedes 5.8 Generic_117350-18 sun4u sparc... (2 Replies)
Discussion started by: dougpss
2 Replies

2. Shell Programming and Scripting

Problem in Running Script

Hi friends, i have written one small script named as "size.sh"..... while running its giving syntax error at line no 2: 'str=$' unexpected. How to run this file ??? please help me. file content is : ----------------------------- #!/bin/sh str=$( df -k | grep /usr/local)... (14 Replies)
Discussion started by: samfrance
14 Replies

3. UNIX for Dummies Questions & Answers

problem running script

hey, i'm trying to run several processes due 2 loops : the code is: cd ${TIBCO_HOME}/tra/domain/${DOMAIN}/application/ for app_name in ls * do echo $app_name if && && ; then exit else echo $app_name cd $app_name pwd for ps_name in ls *.sh do echo... (2 Replies)
Discussion started by: ohadr
2 Replies

4. Shell Programming and Scripting

Problem with running the remote script

Hi All, I am running a script which is present on remote machine using ssh command. the remote script is failing when try to load a property file. It says file does not exist. Any idea what should be the problem for this. Thanks Supriya. (7 Replies)
Discussion started by: supriyabv
7 Replies

5. Shell Programming and Scripting

running perl script problem

While executing perl scriptit gives some compling issue, please help out $inputFilename="c:\allways.pl"; open (FILEH,$inputFilename) or die "Could not open log file"; Error : Could not open log file at c:\allways.pl line 4 learner in Perl (1 Reply)
Discussion started by: allways4u21
1 Replies

6. Shell Programming and Scripting

K script not running / syntax problem

Hi, I have following K script, that is in rc0.d directory to be run on shutdown. It's linked using the 'ln' command to init.d.Can anyone tell me as to why it's not running, or if i have incorrect syntax?I get: "test: argument expected type=uname -p + " When running it with sh -x ... (8 Replies)
Discussion started by: darrlaw
8 Replies

7. Shell Programming and Scripting

Problem in running a shell script

Hi, I'm trying to run a simple shell script whose contents are pasted below. #!/usr/bin/ksh echo $PATH performbuild { echo "Inside performBuild function" } echo "Main Shell started" performbuild echo "Main Shell ended" DV> ls -ltr total 48 -rwxr-xr-x 1 pb5377 it-ibm ... (5 Replies)
Discussion started by: blp_18
5 Replies

8. Shell Programming and Scripting

Problem with crontab running a script

I am trying to use the CRON utility in Fedora 11 & CentOS... I intend to run a script which pops up a warning message every hour and i made the following entry using "CRONTAB -e " * * * * * sh /bin/myscript.sh But this does not seem to be running. Another thing to note is that,... (4 Replies)
Discussion started by: Vabiosis
4 Replies

9. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

10. Emergency UNIX and Linux Support

Problem with running Ghost Script

I have getting problem with running gs on a non global zone. This is new zone. Seems something to do with library, but I am not getting correct pointer. -bash-3.00$ which gs /usr/local/bin/gs -bash-3.00$ gs ld.so.1: gs: fatal: libcairo.so.2: open failed: No such file or directory Killed... (3 Replies)
Discussion started by: solaris_1977
3 Replies
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy