You are not logged in.

#1 2007-04-19 06:31:44

pecan
Member
Registered: 2007-04-06
Posts: 93

Start programs at boot

I haven't yet been able to figure out how to start a program from boot on any distro. I like to run a keyboard daemon called hotkeys (not hotkey), but currently I have to type hotkeys -t msnetpro everytime I want to use it. Any way to make it start and configure the keyboard automatically? 
Thanks

Offline

#2 2007-04-19 06:47:33

sl
Banned
From: uk
Registered: 2007-04-04
Posts: 42
Website

Re: Start programs at boot

you could add the command to /etc/rc.local

Offline

#3 2007-04-19 07:11:40

pecan
Member
Registered: 2007-04-06
Posts: 93

Re: Start programs at boot

Thanks for the advice, but for some reason rc.local won't execute at boot. I can run rc.local and it'll start any programs I want, but it won't automatically load at boot. I have disabled several services on the system I'm trying this on right now (kubuntu) , stuff like cron, could this have any effect?
Thanks

Offline

#4 2007-04-19 10:10:55

Captain Spaulding
Member
Registered: 2006-11-16
Posts: 115
Website

Re: Start programs at boot

On a Debian system the rc.local file is evaluated by the rc.local script in /etc/init.d/rc.local. If the script is there, and it really should be,   run

update-rc.d rc.local defaults 99 01

Read the man page of update-rc.d to understand what this command does.

Offline

#5 2007-04-19 10:28:32

pecan
Member
Registered: 2007-04-06
Posts: 93

Re: Start programs at boot

That worked nicely. Thanks a lot.

Offline

#6 2007-08-06 17:48:57

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: Start programs at boot

How do I start a program at boot as a user different from root?


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#7 2007-08-06 18:04:23

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: Start programs at boot

I guess by using the login environment if kde then a small script in ~/.kde/Autostart as for gnome I suspect there's a similar place. If x then I suspect ~/.xinitrc etc...

As for using rc.local  I think
runuser -s /bin/bash - user -c "xxxx"
found here http://forums.fedoraforum.org/showthread.php?t=122369

Offline

#8 2007-08-06 22:43:17

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Start programs at boot

I suggest

su otheruser -c 'command'

Offline

#9 2007-08-07 08:53:16

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Start programs at boot

Starting programs or services at boot time was one of my biggest challenges when I started using Linux. For a Windows-convert it's not as simple as dragging the icon of your program into the Startup folder in the Windows menu.

Understanding stuff like "runlevels", "BSD / SysV init-style scripts" and eventually (Ba)sh-scripting helped me tremendously, although I have to admit it took me quite a while to get there.

Quick and dirty way to start stuff at boot up: add the command to /etc/rc.local. Slow (because you have to learn) but elegant way: write an init.d/rc.d-script for your program if it doesn't already exist.

If you just want to run stuff when you enter your graphical environment, look at the options of KDE/Gnome/XFce. If you're using a WM like fluxbox, check ~/.xinitrc.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#10 2007-08-07 12:07:05

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Start programs at boot

I came across a solution using fcron and adding this line to the user's crontab:

@reboot command

Hail to the thief!

Offline

#11 2007-08-07 13:05:47

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Start programs at boot

@FUBAR
You obviously have no idea at all how to start a service in windows, it is not as putting an icon the start menu at all. A service is a program who start before the users log in and stops only when the computer turn off or it is stopped manually...
In windows only special coded programs can started this way otherwise you need something like http://www.codeproject.com/system/xyntservice.asp as wrapper.

In linux since all programs are the same, this problem does not exist at all big_smile

Offline

#12 2007-08-07 13:16:54

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Start programs at boot

ezzetabi wrote:

@FUBAR
You obviously have no idea at all how to start a service in windows, it is not as putting an icon the start menu at all. A service is a program who start before the users log in and stops only when the computer turn off or it is stopped manually...
In windows only special coded programs can started this way otherwise you need something like http://www.codeproject.com/system/xyntservice.asp as wrapper.

In linux since all programs are the same, this problem does not exist at all big_smile

I know the difference between a service (daemon), controlled with "services.msc" on Windows, and a simple program run at boot time that can be configured in many different places.
I was just too lazy to type the whole thing.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#13 2007-08-08 10:31:40

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: Start programs at boot

ataraxia wrote:

I suggest

su otheruser -c 'command'

So I just slap that into /etc/rc.local? cool, thanks.


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

Board footer

Powered by FluxBB