LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 11-13-2007, 11:43 PM   #1
maldojr88
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Rep: Reputation: 0
Startup Scripts


hey guys.....i donno if this is the best place to
post this but here i go...
first off im running gutsy (Ubuntu)

well basically i just want to load gaim when i boot...
similar to msconfig in windows....like that applications start up
during boot up.
the location of the application gaim...is

/usr/bin/gaim

so what i did was i created a script call echo:

#!/bin/sh
/usr/bin/gaim


next i ran these commands to accomodate priviledges, place in correct directory and create Symbolic links from rc*.d directories to the /etc/init.d/echo directory

$sudo chmod +x echo
$mv echo /etc/init.d/echo
$sudo update-rc.d echo defaults


When i look in the rc*.d folders i do see the symbolic link to the init.d script and that in the default runlevel the symbolic link begins with an "S"(meaning to start the script as opposed to killing it)

*When i reboot my computer the application does not open. However, when i run the script while Im logged in it works(opens application). Someone told me to use absolute paths in the script because when the scripts are run during boot up the PATH variable has not been set but I am using absolute paths!!!!!

AM i missing something???
Is this possible using System V scripts????

Thanks in advance guys.
 
Old 11-14-2007, 01:05 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
AM i missing something???
Yes you are. Gaim requires X to be running, ideally with a user
logged in. So if you need gaim to fire up when you login, just
check which of ~/.xinitrc and ~/.xsession works for you and the
login manager you're using. Add gaim there, and start it before
the actual WM/DE ... that said: it's quite possible that your
DE/WM has a feature to do this w/o those two files.


Cheers,
Tink
 
Old 11-14-2007, 06:02 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Given that 'echo' is a bash (buit-in?) cmd, I'd recommend using another name to avoid potential problems. How about start_gaim.sh ?
 
Old 11-14-2007, 09:31 AM   #4
ckent
Member
 
Registered: Jan 2007
Distribution: Ubuntu
Posts: 59

Rep: Reputation: 15
just for the sake of occam's razor you could also get it to start on login by going to System > Preferences > Sessions then clicking the Add button and typing gaim (or pidgin) into the Command line. hit ok then close and when you restart it should work.

ck
 
Old 11-14-2007, 10:28 PM   #5
maldojr88
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
check which of ~/.xinitrc and ~/.xsession works for you and the


are these in my home folder?
Because I dont have any of them.
i use ls -a

ok another question...
im just trying to practice these start up scripts.
um what types of start up scripts(meaning wat do they do)
can i create to facilitate my use of linux.
or to enhance my knowledge.
Give me tips a pointers

Last edited by maldojr88; 11-14-2007 at 10:31 PM.
 
Old 11-15-2007, 02:42 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by maldojr88 View Post
are these in my home folder?
Because I dont have any of them.
i use ls -a
Yep - that's what ~/ means. In that case X will use
the system defaults. You could try to create either
of those (and if one has no impact what so ever, move
it to the other name). They should look something like:
Code:
#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi
~/.bashrc

# local changes
/usr/local/bin/tpb&
eval "$(gpg-agent -s --daemon --pinentry-program /usr/bin/pinentry-qt)"
xscreensaver& 
xset b off
/usr/X11R6/bin/root-tail -g 104x43+100+50 /var/log/debug,red,'ALERT' /var/log/m
essages,green&
bsetbg tux_buttler.jpg&

# Start the window manager:
exec /usr/bin/fluxbox


Quote:
Originally Posted by maldojr88 View Post
ok another question...
im just trying to practice these start up scripts.
um what types of start up scripts(meaning wat do they do)
can i create to facilitate my use of linux.
or to enhance my knowledge.
Give me tips a pointers
Well, they really don't make much sense for per-user
stuff. If there were certain activities that you wanted
the machine to do automatically on startup that don't
require anything interactive - that's where start-up
scripts come in.

If, for example, your distro didn't use anacron, and you
happen to be environmentally enlightened and shut your
box down over night - then the slocate-database will not
be updated (unless you modified the crontab to a time
when you KNOW it will be on). To get around that you
could add a script to runlevel 2 that will kick off an
updatedb so the database gets refreshed on every boot.



Cheers,
Tink
 
  


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
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
startup scripts iomari SUSE / openSUSE 2 10-19-2005 01:38 AM
Startup scripts MadnessASAP Linux - Software 2 12-15-2004 07:09 PM
startup scripts mimi Linux - Newbie 6 04-26-2002 03:09 AM
startup scripts mimi Linux - General 1 04-24-2002 03:22 AM

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

All times are GMT -5. The time now is 08:46 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