LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2010, 03:26 AM   #1
KillerCode
Member
 
Registered: Nov 2010
Posts: 57

Rep: Reputation: 0
Startup Under Linux??


i just finished porting my software to linux, and thats my first time with linux
i have a checkbox that Used to add/remove registry key under windows for startup. now under linux i dunno how to add/remove my application from startup?
also do i need root privilages to do so? cause my software runs as a normal user not root or admin
 
Old 11-22-2010, 03:31 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You need to be specific on which distribution have you ported the software. Different distributions have different ways of doing but the best way would be using /etc/rc.local file for starting the application at the start up of your operating system.
 
Old 11-22-2010, 03:58 AM   #3
T0sh1r0
Member
 
Registered: Oct 2010
Location: Ličge, Belgium
Distribution: Debian / Slackware
Posts: 47
Blog Entries: 1

Rep: Reputation: 7
Wink

Welcome to the world of Linux!

It depends which applications you want to start.

If you want to start an application as a daemon (let's say apache or cron), you should check rc.local as Chaitanya suggested and/or add a startup script in /etc/rc.d or /etc/init.d.

If you just want to automatically start an application for your own user (let's say a mail client), then you have to configure your desktop manager (KDE, Gnome, XFCE...) Then go to google (it is your friend if you can ask it the good question ) with something like "KDE startup applications" and you should get the answer.

Hope this helps you.

Last edited by T0sh1r0; 11-22-2010 at 03:59 AM.
 
Old 11-22-2010, 04:08 AM   #4
KillerCode
Member
 
Registered: Nov 2010
Posts: 57

Original Poster
Rep: Reputation: 0
i meant how to do it from software? not manual
like add files to which directory? or whatever that makes my application runs on startup
i cant ask the user to open another application under GNOME for example and add new value with my application name
 
Old 11-22-2010, 04:50 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You can add the entries to /etc/rc.local manually or allow your software installation do that.
 
Old 11-22-2010, 05:00 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by KillerCode View Post
i meant how to do it from software? not manual
like add files to which directory? or whatever that makes my application runs on startup
As already mentioned there is more than one mechanism used so it depends on which distro you want to do it on. Which one(s)?
 
Old 11-22-2010, 05:53 AM   #7
KillerCode
Member
 
Registered: Nov 2010
Posts: 57

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linuxlover.chaitanya View Post
You can add the entries to /etc/rc.local manually or allow your software installation do that.
does that require rootprivilages? cause i tried it and raised cant create file exception
 
Old 11-22-2010, 05:58 AM   #8
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
does that require rootprivilages?
Yes, you do need to be root to write to pretty much anything in the /etc directory.
 
Old 11-22-2010, 06:19 AM   #9
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by KillerCode View Post
does that require rootprivilages? cause i tried it and raised cant create file exception
Also remember that /etc/rc.local file is already present. You DO NOT create file by that name. You add entries to the file for the applications that need startup at boot.
 
Old 11-22-2010, 09:16 AM   #10
KillerCode
Member
 
Registered: Nov 2010
Posts: 57

Original Poster
Rep: Reputation: 0
is there anyway that doesnt need root privilages?
cause the user should do it with single click, like GNOME startup editor, this one asks for no privilages
 
Old 11-22-2010, 09:36 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by KillerCode View Post
is there anyway that doesnt need root privilages?
cause the user should do it with single click, like GNOME startup editor, this one asks for no privilages
No. Ordinarily the files and directories in the boot script system can be changed only by root. If they were not it would offer a privilege escalation opportunity allowing arbitrary code to be run as root because the boot scripts are run by root.

Software can be installed by unprivileged users in their home directories and may be started by them at logon but they cannot have software started at boot.

The scheme is not so different from Windows where only members of the Administrative groups can install a service; the only difference is Window's kamikaze arrangement of having users in the Administrative groups by default.
 
Old 11-22-2010, 09:42 AM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
The application runs in user land, so you should probably be looking at the desktop environment you intend to run your software under.

Nowadays, and assuming that the distro you intend to run this under is not from the stone age, what I would do is to check for ~/.config/autostart/<your_file>.desktop, if it doesn't exist then create it. You can google to find the syntax for valid freedesktop's .desktop files. I put a random one from my home as an example:

Code:
$ cat .config/autostart/gkrellm.desktop 
[Desktop Entry]
Comment=Monitoriza el hardware local
Comment[es_ES]=Monitoriza el hardware local
Exec=gkrellm
Hidden=true
Name=Monitor Local
Name[es_ES]=Monitor Local
Type=Application
X-GNOME-Autostart-enabled=true
The session managers and control centers from mainstream desktops usually offer a way to configure (mainly enable and disable) session elements.

Last edited by i92guboj; 11-22-2010 at 09:43 AM.
 
Old 11-22-2010, 10:23 AM   #13
KillerCode
Member
 
Registered: Nov 2010
Posts: 57

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
The application runs in user land, so you should probably be looking at the desktop environment you intend to run your software under.

Nowadays, and assuming that the distro you intend to run this under is not from the stone age, what I would do is to check for ~/.config/autostart/<your_file>.desktop, if it doesn't exist then create it. You can google to find the syntax for valid freedesktop's .desktop files. I put a random one from my home as an example:

Code:
$ cat .config/autostart/gkrellm.desktop 
[Desktop Entry]
Comment=Monitoriza el hardware local
Comment[es_ES]=Monitoriza el hardware local
Exec=gkrellm
Hidden=true
Name=Monitor Local
Name[es_ES]=Monitor Local
Type=Application
X-GNOME-Autostart-enabled=true
The session managers and control centers from mainstream desktops usually offer a way to configure (mainly enable and disable) session elements.
WHOHOOOOOOOOOOO!
man ur the best!

this works for gnome only?
or all desktops use this path (~/.config/autostart) just diffrent scripts?
 
Old 11-22-2010, 10:33 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
That depends on how good the DE (desktop environment) "freedesktop-ness" is.

The freedesktop aims to create a set of specifications on how applications should interact with the DE, so you can make sure that things like the window manager hints, the system tray, the autostart folders and many other things will work no matter what DE you are using at a given momment. You can visit freedesktop.org to get you started. The concrete info that applies in this case is this:

http://standards.freedesktop.org/aut...ec-latest.html

So, the answer is that it *should* work on any recent distro with any mainstream DE and some mainstream up-to-date standalone window managers that can do session handling.
 
Old 11-22-2010, 10:37 AM   #15
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by KillerCode View Post
this works for gnome only?
or all desktops use this path (~/.config/autostart) just diffrent scripts?
Xfce also uses ~/.config/autostart but the format of the files is slightly different. Here's one created interactively for a home-grown script:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Desktop background cycler
Comment=
Exec=/home/c/bin/XfceBackdropChanger.sh
StartupNotify=false
Terminal=false
Hidden=false
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Changing startup to load an image instead of showing kernel/startup information. orangesky Programming 1 05-25-2010 02:29 AM
Managing startup programs; removing YOU icon from startup General SUSE / openSUSE 2 06-14-2007 08:48 PM
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
My Redhat Linux 9 machine won't startup but gives a startup error" njugs79 Linux - Newbie 2 03-23-2005 12:50 AM


All times are GMT -5. The time now is 03:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration