Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adding a startup program Mandriva 2010.2

Posted on 2011-03-02
13
Medium Priority
?
697 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1000 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
 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

688 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