LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 04-29-2011, 04:46 PM   #1
DSchuler
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Rep: Reputation: 0
Script run at startup doesn't work under Ubuntu 10.04 LTS


I've got a script than ran fine under Ubuntu 7.10 but I'm having a problem with it under Ubuntu 10.04 LTS.

The script runs fine when executed via sudo.

The script is in /etc/init.d, it's executable, I registered it with update-rc.d, and (according to ps) it's running. It just doesn't work.

Here's the script:

#!/bin/bash
cd /home/xxxx
while [ true ]; do
kermit -q <pc.kcs
sleep 5
done

kermit is installed and runs properly, the directory /home/xxxx exists, the file pc.kcs exists (remember: the script runs when executed via sudo).

Ideas?

Am I in the correct forum?
 
Old 04-29-2011, 05:27 PM   #2
jthill
Member
 
Registered: Mar 2010
Distribution: Arch
Posts: 209

Rep: Reputation: 66
I see from its manpage that there's a -B option:
Quote:
−B Kermit is running in Batch or Background (no controlling terminal). To be used in case Kermit
doesn’t automatically sense its background status. Equivalent to the SET BACKGROUND ON
command.
 
Old 04-29-2011, 07:40 PM   #3
DSchuler
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
I'll give that a try. I wonder why it would work fine when run under 7.10 as a background task and under 10.04 when started from the command line.
 
Old 05-02-2011, 01:29 PM   #4
DSchuler
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Adding the "-B" flag didn't help. Still won't run.

Anybody have an idea?
 
Old 05-02-2011, 09:31 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Can you see any error msgs?
Try
Code:
set -xv
as the 2nd line ie immediately after the bash invocation; this will print out exactly what its trying to do/doing.
 
Old 05-03-2011, 12:59 PM   #6
DSchuler
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
That didn't do anything for me, either. It doesn't appear to produce any output.

kermit is executing--I can tell that from the system logs. Here's the kermit script I'm executing

Quote:
lcd /tmp
ftp open xyz.com
xxxxxxxxx@xyz.com
xxxxxxxxxxx
cd 1
binary
ls >ls.out
open read ls.out
read line
read line
read line
while success {echo \m(line),assign \%x \Fword(\m(line),12).pdf,echo \%x,assign %f \%x,if equal {\%f} {.lock} break,get \%f,run /home/golf/printlabel \%f,delete \%f,read line}
close read
close
run rm /tmp/*
exit
The connect is happening and the rm of the files from the /tmp directory is happening so I know the script is executing. It's just not doing what it did.

What's got me baffled is that it worked fine under 7.10 and the shell script works fine when executed by typing /home/xxxx/pc.s on the command line. It just doesn't execute properly within the script executed at system startup.

I guess I'm going to need to re-debug the kermit script.

Last edited by DSchuler; 05-03-2011 at 01:08 PM.
 
Old 05-03-2011, 08:42 PM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
If you're running it at startup, it's prob an environment settings thing. You can use that cmd I showed, but you'll have to re-direct the output to a log somewhere eg

/path/yourscript >/tmp/yourscript.log 2>&1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NIC 3Com900 PCI doesn't work on Ubuntu 10.02 LTS juancacer Linux - Newbie 1 09-25-2010 02:05 AM
UBUNTU: can I run startup script only (not on shutdown)? fopetesl Linux - Software 8 06-10-2010 04:16 AM
script doesn't work during startup of the pc shipon_97 Linux - Enterprise 3 04-30-2007 01:38 PM
Startup Script Doesn't Work. jonwatson Linux - Newbie 2 03-24-2006 09:55 AM
startup script to set up iptables rules doesn't run alexfittyfives Debian 2 06-01-2004 08:21 PM


All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration