Solved

Adding a startup program Mandriva 2010.2

Posted on 2011-03-02
13
646 Views
Last Modified: 2013-11-13
I want to start a program whenever I log on.
The program is ATI Config and I use it to underclock my GPU.
0
Comment
Question by:_3mp3ror_
  • 7
  • 6
13 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 35023728
If you are logging with command line, you can use your shell initialization scripts to do that for you.
For bash you may use ~/.bash_profile.  You may also use /etc/profile.

0
 
LVL 31

Expert Comment

by:farzanj
ID: 35023745
You may want to put it to rc.local.  If you are using GUI, I have to know which GUI are you using.
0
 
LVL 9

Author Comment

by:_3mp3ror_
ID: 35025491
I am using gnome as my gui but I want to know how to do it via command line.

@farzanj
I don't have the .bash_profile in my home dir but I do have it in root home dir

The /etc/profile has these entries
# /etc/profile -*- Mode: shell-script -*- 
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>

loginsh=1

if [ "$UID" -ge 500 ] && ! echo ${PATH} |grep -q /usr/games ; then
    PATH=$PATH:/usr/games
fi

umask 022

USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HISTCONTROL=ignoredups
HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

# some old programs still use it (eg: "man"), and it is also
# required for level1 compliance for LI18NUX2000
NLSPATH=/usr/share/locale/%l/%N

export PATH PS1 USER LOGNAME MAIL HOSTNAME INPUTRC NLSPATH
export HISTCONTROL HISTSIZE 

for i in /etc/profile.d/*.sh ; do
	if [ -r $i ]; then
		. $i
	fi
done

unset i

Open in new window


/etc/rc.local

#!/bin/sh
#
### BEGIN INIT INFO
# Provides: rc.local
# X-Mandriva-Compat-Mode
# Default-Start: 2 3 4 5
# Short-Description: Local initialization script
# Description: This script will be executed *after* all the other init scripts.
#              You can put your own initialization stuff in here if you don't
#              want to do the full Sys V style init stuff.
### END INIT INFO

touch /var/lock/subsys/local
pppoe-start

Open in new window


the path to the application
/home/[user]/Downloads/107457-atioc_x86_64_105

should I move it somewhere else or leave it in my home directory ?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35026526
rc.local is executed at the boot time of the machine.  If you want it to get executed when you log on, then you should put the stuff in

~/.bash_profile

If there is no file in the related account, create one.  What is your default shell for the user that should run executable?  Bash?  Are you logging in for command line session or GUI?  If it is GUI, which one ; GNOME, KDE, etc?
0
 
LVL 9

Author Comment

by:_3mp3ror_
ID: 35027248
GNU bash, version 4.1.5(2)-release (x86_64-mandriva-linux-gnu)

Gnome Desktop

Logging in from GUI

I have a bash_profile in the root home folder

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

mesg n

Open in new window


what should I add to it after I copy this file to my home folder ?
0
 
LVL 31

Accepted Solution

by:
farzanj earned 250 total points
ID: 35027868
Here is what I think.

Since you are logging in as a GUI user, bash is not related.  I think it would only trigger if you are logging using terminal.

Try using one of the two files

$HOME/.gnome2/session-manual

or put something in:

$HOME/.config/autostart/
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Author Comment

by:_3mp3ror_
ID: 35028383
I created a new file in $HOME /.config/autostart by using gnome's autostart manager
#!/usr/bin/env xdg-open

[Desktop Entry]
Type=Application
Exec=/home/samsar/Downloads/107457-atioc_x86_64_105
Hidden=false
X-GNOME-Autostart-enabled=true
Name[en_US]=ATI Config
Name=ATI Config
Comment[en_US]=
Comment=

Open in new window


The startup is ok but I don't know if I can close the window after I log-on.

Is there a way to auto-close the window after startup ?

I tried hidden=true but then it did not start. window
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35030190
You could write another script to kill it but why would you want to do it?
0
 
LVL 9

Author Comment

by:_3mp3ror_
ID: 35030953
not kill the app, just close it.
If I close it normally it behaves like the system tray in windows.  I can still access the program because I have the program's icon near the clock in the upper right corner.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35031246
You can try doing to settings.  It may have an option to run as a Daemon only.  Or you may have command line switches to open it as background
OR at the end of the line try adding & so that it tries to open it in the background.
0
 
LVL 9

Author Comment

by:_3mp3ror_
ID: 35032456
I only have these options in the program.
The ampersand does not help.
 windows-s
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35033450
I am  not familiar with this driver.  I don't have it even installed.  I tried online but could not see any documentation.  If possible, I would have looked into the documentation or its config file.  I thing there is one:
$HOME/.config/atioc/atioc.conf

If there are any man pages, please find it and it may have some option there or in the conf file, may be.
0
 
LVL 9

Author Closing Comment

by:_3mp3ror_
ID: 35035006
http://phoronix.com/forums/showthread.php?17331-ATI-Overclocking-Utility/page14

It seems that the developer will add the minimize feature in the future.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now