LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-02-2004, 07:19 PM   #1
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Rep: Reputation: 15
execute program only once during login


I want to execute a program only once when login.

If I put the program execution in .bashrc, then it will get executed for every shell, i.e. more than once.

I put my desired program inside ~/.bash_profile but the program does not work as expected.

The ~/.bash_profile file are as follows:
# /etc/skel/.bash_profile:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bash_profile,v 1.10 2002/11/18 19:39:22 azarah Exp $

#This file is sourced by bash when you log in interactively.
[ -f ~/.bashrc ] && . ~/.bashrc

/usr/bin/amixer sset 'VIA DXS',0, 31




My desired program is to set the volume to 100%:
/usr/bin/amixer sset 'VIA DXS',0, 31

However, the volume is still very low after login so I still need to execute the program at the shell after login.

My linux is Linux version 2.6.8-gentoo-r4.
 
Old 11-02-2004, 07:54 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You only want it executed during your first login of each boot?
 
Old 11-02-2004, 08:08 PM   #3
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
Looked at rc.local yet?


Cheers,
Tink
 
Old 11-02-2004, 08:09 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Accidental duplicate, sorry.

Last edited by Matir; 11-02-2004 at 08:11 PM.
 
Old 11-02-2004, 08:09 PM   #5
m00t00
Member
 
Registered: Sep 2004
Distribution: Slackware 10, Gentoo
Posts: 292

Rep: Reputation: 30
put it in a boot script, not in a shell config file.
 
Old 11-03-2004, 08:52 AM   #6
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Original Poster
Rep: Reputation: 15
Gentoo Linux does not provide such a file rc.local. Instead it has an equivalent script called /etc/conf.d/local.start where you can put all your initialization stuff.
However I still need to do
/usr/bin/amixer sset 'VIA DXS',0, 31
after I login in.

cat /etc/conf.d/local.start
# /etc/conf.d/local.start:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $

# This is a good place to load any misc.
# programs on startup ( 1>&2 )
# this file is similar to
/usr/bin/amixer sset 'VIA DXS',0, 31

#end of file

Quote:
Originally posted by Tinkster
Looked at rc.local yet?


Cheers,
Tink
 
Old 11-03-2004, 08:55 AM   #7
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Original Poster
Rep: Reputation: 15
Which file for gentoo linux?
I tried
/etc/conf.d/local.start
but does not work.
Please see my previous post.

Quote:
Originally posted by m00t00
put it in a boot script, not in a shell config file.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute c++ program Daz_Man2803 Programming 8 06-09-2005 11:28 AM
How do I execute a program? erick99 Linux - Software 1 10-11-2004 07:56 AM
C function to execute a program and return the output of the program ryan.n Programming 4 08-14-2004 10:11 PM
how to execute automatically a program/script after login mule Linux - General 8 12-13-2003 02:44 PM
execute a program athenerx Programming 3 05-23-2002 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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