You are not logged in.

#1 2011-09-15 07:25:25

Raptorista
Member
From: Italy
Registered: 2011-08-01
Posts: 42

Commands on startup

Good morning everybody!
I have a [minor] issue with my ArchLinux: each time I boot it, I need to run a couple of simple commands in order to make everything work fine [i.e. there's one to start internet connection and another one to make the webcam work].
I tried putting them in /etc/rc.local, and this way they actually get executed at the system boot, but the problem is that these commands sometimes take nearly a minute to execute, so my boot time is increased by this time, and I have to wait until they finish because only afterwards KDE gets executed and I can login.

So my question is: is there any way to get these commands executed after KDE [i.e. after xinit]? I mean, I'd like them to run in the background while I login and the system loads KDE, so that I'd have a shorter boot time.

I tried making a script and using KDE's "operation scheduler" [not sure about the name, I translated it from mine which is in Italian] but it doesn't work, possibly because the commands I try to execute require root privileges.

Any help really appreciated wink
Thanks in advance!

Offline

#2 2011-09-15 07:40:39

cybertorture
Member
Registered: 2010-05-05
Posts: 339

Re: Commands on startup

try to put "&" at end of command line in /etc/rc.local

Last edited by cybertorture (2011-09-15 07:41:35)


O' rly ? Ya rly Oo

Offline

#3 2011-09-15 08:26:30

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Commands on startup

Your net connection should be configured either in /etc/rc.conf or by using netcfg/wicd/<other_such_utility>. "making the webcam work" is vague, but I'm assuming you mean loading the driver for it - this should also be done in /etc/rc.conf.

More details - i.e. the actual commands you're running - would help. In general, try the recommended methods first - if they don't work, investigate to find out why, instead of looking for workarounds.

Offline

#4 2011-09-15 08:47:21

Raptorista
Member
From: Italy
Registered: 2011-08-01
Posts: 42

Re: Commands on startup

@cybertorture: your hint worked fine, thanks.

@tomk: I'd like to set those things correctly as you suggest.
My /etc/rc.local actually looks like this

$ cat /etc/rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

dhcpcd eth0 &
/usr/local/bin/uvcvideo_fix.sh &
modprobe vboxnetflt &
hwclock --systohc &

# exit 0

where:
dhcpcd eth0    makes the connection work. The inner problem is with the DNS: if I didn't run this command, pinging a website by IP address would work, whereas pinging by name would not

/usr/local/bin/uvcvideo_fix.sh is a script that reloasd the webcam driver until it is correctly loaded

modprobe vboxnetflt  loads the module to be used with virtualbox

hwclock --systohc is something I thougth to be useful but that actually I should remove.


Ok, tell me how could I make this better-set smile

Offline

#5 2011-09-15 16:39:03

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Commands on startup

I don't need to tell you anything - just read rc.conf, the comments explain it. There are various relevant wiki pages also.

It seems you didn't read any docs when you were installing, this is very basic Arch configuration.

As for uvcvideo_fix.sh, if you need it, leave it in rc.local, but are you sure it's necessary? Can you not load its driver in the usual way?

Offline

#6 2011-09-15 16:58:37

Raptorista
Member
From: Italy
Registered: 2011-08-01
Posts: 42

Re: Commands on startup

Just to let you know, I actually DID read the config file while installing. tongue
Anyway, I've added vboxnetflt in the modules section in rc.conf, so [I guess] I can remove "modprobe vboxnetflt" from rc.local.

As fare as others are concerned, I don't know how to remove "dhcpcd eth0" from rc.local and put something equivalent in rc.conf. The problem should be with the DNS, but I don't have a clue where to set it in rc.conf.

Yes, uvcvideo_fix.sh is needed. Inside it there is a loop that continues doing

modprobe -r uvcvideo
modprobe uvcvdeo

untill uvcvideo is correctly loaded. It also takes different numbers of tries each time, so it's kinda casual.

Offline

#7 2011-09-15 17:08:08

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Commands on startup

If you had read the file you would know how to configure your network connection - there's an example included. As already mentioned, this is very well documented, in the rc.conf comments, the install guide, the beginners guide, the wiki's network page, etc, etc,....

Helpful info: DHCP autoconfigures DNS.

Finally, if I had that webcam issue, I would try to establish what the problem is, instead of using a script like that But sure, stick with it if you want.

Offline

#8 2011-09-15 17:29:04

Raptorista
Member
From: Italy
Registered: 2011-08-01
Posts: 42

Re: Commands on startup

I had already read the wiki, tried to configure following the docs instructions and still found nothing.
I would not be using Arch linux if I didn't feel like reading docs..

I know DHCP autoconfigres DNS, in fact I did not have this problem on Ubuntu, but that's why I don't have a clue what the problem could be, for I didn't touch anything neither did anything different from when I installed Ubuntu or Gentoo, and the workaround doesn't seem that painful to me though.

About the webcam, I'd be very happy to find out what the problem is, but I'm not expert enough to understand it, and same reasoning as previous one applies.

I'll look for further readings sooner or later!

Offline

Board footer

Powered by FluxBB