LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-25-2006, 07:50 PM   #31
jturnbul
Member
 
Registered: Sep 2004
Location: Toronto, Canada
Distribution: Fedora 4 - Slackware 10 - PHLAK
Posts: 92

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by gilead
The problem is that you don't have bash set as your shell. The line for jnt should end in /bin/bash the same as gdm's line does.
How did that happen?, and better yet how do I fix it???
 
Old 01-25-2006, 08:30 PM   #32
jturnbul
Member
 
Registered: Sep 2004
Location: Toronto, Canada
Distribution: Fedora 4 - Slackware 10 - PHLAK
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jturnbul
better yet how do I fix it???
well solved that one myself by just editing passws as root and adding /bin/bash to my directory.
 
Old 01-25-2006, 08:49 PM   #33
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
try "man bash" then "/INVOCATION" (yes, use caps) - then hit "n" a couple of times to get to the right section, which describes the order of reading startup files, BASH_ENV, and lots of other stuff.

 
Old 01-25-2006, 08:58 PM   #34
jturnbul
Member
 
Registered: Sep 2004
Location: Toronto, Canada
Distribution: Fedora 4 - Slackware 10 - PHLAK
Posts: 92

Original Poster
Rep: Reputation: 15
finally done. Thanks to all those who replied.
Once i got /bin/bash into my directory, i just had to use what was suggested in the earlier posts of editing .bash_profile, and having it cd to the directory and running the command.

Now for some modifications. I have the program start up in the background, however there is verbose information displayed across the screen, as the program starts up. How do i redirect that info to the bit bucket, so it is completely behind the scenes?

Also, I am running into the problem mentioned earlier, that once I am in KDE (GUI) and open a terminal, it tries to run the program again. Not a huge issue, as it just says another instance of the program is running, and ignores the command, but I would like to learn how to prevent that.

Thanks again to all of you, you have helped me learn alot.
 
Old 01-25-2006, 09:02 PM   #35
jturnbul
Member
 
Registered: Sep 2004
Location: Toronto, Canada
Distribution: Fedora 4 - Slackware 10 - PHLAK
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Genesee
try "man bash" then "/INVOCATION" (yes, use caps) - then hit "n" a couple of times to get to the right section, which describes the order of reading startup files, BASH_ENV, and lots of other stuff.

so where would I add the --noprofile option?? I think thats what would stop bash from running .bash_profile again, when I open a terminal??
 
Old 01-26-2006, 10:54 AM   #36
Jelle
Member
 
Registered: Feb 2004
Location: Utrecht, The Netherlands
Distribution: Debian
Posts: 79

Rep: Reputation: 15
I don't think that is the right way to go, there might be other stuff in your profile that you do want set. use something like: [HTML]
if [ ! -e /tmp/yourprogram/yourprogram.pid ] ; then
mkdir -p /tmp/yourprogramname
echo $$> /tmp/yourprogram/yourprogram.pid
#now start up the program itself
/path/to/your/program
#if the program exited normally, this will clean up the pid file
rm /tmp/yourprogram/yourprogram.pid
fi [/HTML]
Put this file somewhere in your path (~/bin usually works) and call that from your profile.
Pleaseo not put this snippet directly into production, I just wrote it on the fly so you can be sure some flies and bug will be hiding in it.

Last edited by Jelle; 01-26-2006 at 11:02 AM. Reason: fixed formatting of code
 
Old 01-26-2006, 12:00 PM   #37
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
How do i redirect that info to the bit bucket, so it is completely behind the scenes?
You want to redirect the standard output and standard error (output) from the screen to /dev/null. Check the web for the Advanced Bash Scripting How-To.

Quote:
Also, I am running into the problem mentioned earlier, that once I am in KDE (GUI) and open a terminal, it tries to run the program again.
That indicates that although you placed the program in ~./bash_profile, which runs only once during the actual login, unlike .bashrc, that you are starting Konsole (or xterm, etc.) with the login shell option rather than just opening a terminal session. Consider some options to help you with that:

1. Edit ~/.bash_profile in a manner similar as suggested by Jelle so that only one instance always runs. You also might consider looking into the /sbin/pidof command, which is handy to help determine whether a program is already running. That command is kind of like a combination of ps ax | grep "whatever" and returns the pid of the program you seek.

2. Configure Konsole (or xterm, etc) with the correct options such that you normally are not running another login shell and instead run only a terminal shell. If you are using KDE, then you can place a handy icon in your Quick Launch area of the Kicker task bar. On the Kicker task bar, use your secondary mouse button to open the pop-up context menu. Then select Add to Panel, then Special Button, then Terminal Sessions. That icon will present to you several ways to start Konsole and the first option will be simply a (non-login) terminal shell, although other options will include Linux Console, root shell, etc.
 
  


Reply



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
Start at Boot - After X, before login. grim1234 Slackware 2 11-05-2005 11:00 AM
start gui based program after user login shahidawan Linux - General 9 07-27-2005 08:46 PM
How do I start a program on boot ? overproof Mandriva 4 04-22-2005 07:13 AM
How to start program on X login donbellioni Linux - General 11 07-28-2004 04:45 PM
program start at boot moonloader Slackware 4 03-08-2004 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:24 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
Open Source Consulting | Domain Registration