Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 711
  • Last Modified:

Adding a startup program Mandriva 2010.2

I want to start a program whenever I log on.
The program is ATI Config and I use it to underclock my GPU.
0
_3mp3ror_
Asked:
_3mp3ror_
  • 7
  • 6
1 Solution
 
farzanjCommented:
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
 
farzanjCommented:
You may want to put it to rc.local.  If you are using GUI, I have to know which GUI are you using.
0
 
_3mp3ror_Author Commented:
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
farzanjCommented:
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
 
_3mp3ror_Author Commented:
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
 
farzanjCommented:
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
 
_3mp3ror_Author Commented:
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
 
farzanjCommented:
You could write another script to kill it but why would you want to do it?
0
 
_3mp3ror_Author Commented:
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
 
farzanjCommented:
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
 
_3mp3ror_Author Commented:
I only have these options in the program.
The ampersand does not help.
 windows-s
0
 
farzanjCommented:
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
 
_3mp3ror_Author Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now