LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-23-2007, 09:27 AM   #1
ineya
Member
 
Registered: Jul 2007
Posts: 39

Rep: Reputation: 16
script connecting to erlang shell works only in interactive mode


I'm connecting to erlang shell of ejabberd server this way:
Code:
erl -sname node9 -remsh ejabberd@myserver
this works fine, but when I put it in script, which is called by cron/atd it doesn't work and I'm not able to connect to correct node "ejabberd".

The only thing I know is that, it works in interactive mode -> when somebody is running shell (ssh/...). But when the script is executed by some deamon or process, which doesn't have TTY associated (<- I'm not sure if I get this right) then it doesn't work.

So my problem is to simulate, that somebody is running interactive shell, where this erlang shell can be attached (more confusion here).

Is there a way to attach e.g. tty6 to running process? (again confusion) Or how to trick the erlang so I can get erlang shell in script.

Thank you
 
Old 10-25-2007, 07:05 AM   #2
wolfperkins
Member
 
Registered: Oct 2007
Location: Val-des-Monts, Québec, Canada
Distribution: CentOS, RHEL, Fedora
Posts: 109

Rep: Reputation: 16
At the top of the script you could add

#!/bin/bash
. ~/.bashrc

This would load the shell of your choice (change to /bin/ksh if you prefer). Just ensure that you load the right startup files for selected shell.
 
  


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
C Shell, while loop in interactive mode? jhwilliams Programming 6 06-27-2007 02:16 PM
Command that works on BASH promp but not from a shell script! ChrisScott Linux - General 4 11-27-2006 07:11 PM
shell script read non-interactive comtmr Linux - General 6 11-01-2006 06:54 AM
bash script works when interactive, endless loop when started via cron dguy Linux - General 5 04-10-2006 11:39 AM
Shell script works on RH 7.2 but not on RH ES brian Red Hat 1 08-31-2004 11:55 AM


All times are GMT -5. The time now is 04:24 PM.

Main Menu
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