LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-31-2009, 04:32 AM   #1
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Rep: Reputation: 30
Question NS2 runs as root user and not as other user


Hello,
I can run simulations scripts successfully as a root user but when I run the same script as a user other than root, I get this error message:

Quote:
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
/MyApps/ns-allinone-2.32/tcl8.4.14/library:/usr/lib /root/ns-allinone-2.32/lib/tcl8.4 /MyApps/ns-allinone-2.32/tcl8.4.14/library:/usr/lib /MyApps/ns-allinone-2.32/tcl8.4.14/library:/usr/tcl8.4 /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 /usr/local/library /usr/library /usr/tcl8.4.15/library /tcl8.4.15/library /root/ns-allinone-2.32/lib/tcl8.4



This probably means that Tcl wasn't installed properly.

invalid command name "Simulator"
while executing
"Simulator"
invoked from within
"set ns [Simulator]"
(file "ex1.tcl" line 1)
Although, "ns" command shows the "%" sign. Please guide.
Regards.

Last edited by mq15; 10-31-2009 at 04:36 AM.
 
Old 10-31-2009, 05:42 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,322

Rep: Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581
May be you did set all the PATH's as root ? ?

"Users" have their own path's , and the ns-allinone
path's must be set for each user.
.....
Or avoid having any PATH issues at all, just install
a few files into the system path's , post # 13 here
http://www.linuxquestions.org/questi...ora-11-750634/
.....
.....
Other ns2 info : LQ Search > > Tagname = ns2
.....

Using ' ex1.tcl ' : The command is : ' ns ex1.tcl '.
If you do ' ns <Enter> ' , you get the ' ns shell ',
which is for other purpose.
.....

Last edited by knudfl; 10-31-2009 at 05:53 AM.
 
Old 10-31-2009, 10:03 AM   #3
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Thanks knudfl.
But I have already edited the ~/.bashrc separately for the other user. And the paths are set correctly I am sure. Even then this happens ?
 
Old 10-31-2009, 03:32 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,322

Rep: Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581
I guess, you will have to build ns-allinone in your /home/
to have the right permissions.
/root/ is not the location to keep it in. No users can read or
access that directory, and thus not use any files inside /root/.
/root/ is not supposed to be used for anything . Never !

A standard build location : /home/'user'/ns2/ns-allinone-2.32/
but /usr/local/ns2/ may be usable too.

Last edited by knudfl; 11-01-2009 at 06:47 AM.
 
Old 11-01-2009, 08:43 AM   #5
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Now I have changed the ns2's location to /home/Program_Files/ns-allinone-2.32/. I have also run these commands:

Quote:
chown -R mq15 /home/Program_Files
chmod -R u+rwx /home/Program_Files
And edited and 'source'd the .bashrc accordingly but still get same message.

Last edited by mq15; 11-01-2009 at 08:44 AM.
 
Old 11-01-2009, 12:38 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,322

Rep: Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581
" chown -R mq15 /home/Program_Files " etc.

Looks for me, that you just moved or copied the whole
folder ns-allinone-2.32/ from /root/ ? ?

And the "new folder" is not to be in /home/'new-folder',
but /home/"user"/'new-folder'/ . Else you will have
similar permissions problems again. !


Better start from scratch in another folder with a new
name like /home/mq15/ns2/ to be absolute sure for it
to work.
And please run all commands as the ordinary user. No 'su'.

By the way : The latest version is ' 2.34 '.

And please consider this again :
http://www.linuxquestions.org/questi...ora-11-750634/
→ → post # 13 : Makes everything much much easier. ... ...
.....

Last edited by knudfl; 11-02-2009 at 03:48 AM.
 
Old 11-02-2009, 11:10 AM   #7
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Please suggest me solution considering me as a newbie. I am not familiar to Linux environment at all.
 
Old 11-02-2009, 01:46 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,322

Rep: Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581Reputation: 3581
Well then let us try this :

Log in to your username.

Open the terminal window and type ...
1) mkdir ns2
2) cd ns2/
3) ... ... ... ... copy or move the ns-allinone-2.32.tar.gz into ns2/
4) tar xvf ns-allinone-2.32.tar.gz
5) cd ns-allinone-2.32/
6) ./install
..... And please use the finishing text to set the new paths.
..... May be copy / paste that text to a text file to have a backup.
.....
.....
.....

Last edited by knudfl; 11-02-2009 at 05:03 PM.
 
Old 11-04-2009, 08:31 AM   #9
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Fedora 9
Posts: 192

Original Poster
Rep: Reputation: 30
Thanks knudfl for your help...
The problem has been solved. I removed ns-allinone-2.32, installed ns-allinone-2.34, updated ~/.bashrc and sourced it. Then updated and sourced the ~/.bashrc separately for other user.
 
  


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
Flash runs OK as root, won't run as user in Fedora 8 Cogar Fedora 1 11-14-2007 05:48 AM
xine runs as root, but segfaults as user fatblueduck Linux - Software 3 05-09-2006 04:26 AM
Command runs as root but cant be founfd with regular user Mr_Oz Linux - General 2 02-21-2006 05:53 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-08-2004 12:11 AM
root=mozilla runs, user=no worky the_tflk Linux - Software 5 07-13-2003 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:05 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration