How to start a program at boot time?

I do this every time.


ifup dsl0

How can i set this to start at boot time?

Can’t it be configured using YaST > Network devices ?

I ask because you just have very short description without much detail. I do not think ver y much people here do bother to start heir network devices by hand on boot. That is allready cared for (by configuring in YaST and using traditional ifup).

Henk’s question is a good one. But, assuming you have a good reason (that normal tools don’t work), you can put the command as a single line in the file /etc/init.d/boot.local. If that doesn’t work because it’s too soon in the boot process, there is a slightly more complicated way which I can describe if necessary, so let me know.

On Fri, 02 Jul 2010 13:41:43 +0000, colao wrote for a reply:

> I do this every time.
>
> Code:
> --------------------
>
> ifup dsl0
>
> --------------------
>
> How can i set this to start at boot time?

Code:

Toolbar => System => System => Startup Applications => add entry for ifup
dsl0


Chillingout@opensuse.forum

On Fri, 02 Jul 2010 19:27:32 GMT swerdna <> wrote:

>
> Henk’s question is a good one. But, assuming you have a good reason
> (that normal tools don’t work), you can put the command as a single
> line in the file /etc/init.d/boot.local. If that doesn’t work because
> it’s too soon in the boot process, there is a slightly more
> complicated way which I can describe if necessary, so let me know.

use :

/etc/init.d/after.local

instead :slight_smile:

Assuming that normal network setup tools do not work, of course :wink:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

@chill out
Which toolbar of what?

@Carlos E.R.
That is a good one. New to me (and imho to most of us). Because it does not allready exist as an empty one like /etc/init.d/boot.local.
I checked in* /etc/init.d/rc* and it checks for the existence and then executes as last one in the sequence. That is the solution for those actions where boot.local is to early!
Thanks Carlos.

BTW, while Carlos’ solution will work for the OP imho, I do not know if the OP should not try to solve his problem by configuring in YaST.

@Carlos, cheers. Did not know this one. You gave me a solution to something I work around in a network I manage. ATM I use a script which sleeps for some secs then executes some commands. Using after.local does it straight away. Learning every day and liking it.

@OP: think about Henk’s solution first. It’s a network issue, configuring the networking properly should arrange things without extra measures.

On 2010-07-03 08:16 GMT hcvv wrote:

> @Carlos E.R.
> That is a good one. New to me (and imho to most of us). Because it
> does not allready exist as an empty one like -/etc/init.d/boot.local-.
> I checked in- /etc/init.d/rc- and it checks for the existence and then
> executes as last one in the sequence. That is the solution for those
> actions where -boot.local- is to early!
> Thanks Carlos.

Welcome! :slight_smile:

I think I was reading once that rc file for some other reason and found
that out per chance. Or somebody mentioned it in passing, dunno. It is
a recent addition, by the way (11.1 or thereabouts): what I did before
was create a new service for whatever I needed.

> BTW, while Carlos’ solution will work for the OP imho, I do not know
> if the OP should not try to solve his problem by configuring in YaST.

Absolutely.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

On Sat, 03 Jul 2010 08:16:01 +0000, hcvv wrote for a reply:

> @chill out
> Which toolbar of what?
>
> @Carlos E.R.
> That is a good one. New to me (and imho to most of us). Because it does
> not allready exist as an empty one like -/etc/init.d/boot.local-. I
> checked in- /etc/init.d/rc- and it checks for the existence and then
> executes as last one in the sequence. That is the solution for those
> actions where -boot.local- is to early! Thanks Carlos.
>
> BTW, while Carlos’ solution will work for the OP imho, I do not know if
> the OP should not try to solve his problem by configuring in YaST.

In OpenSuse 11.1 :

  1. On the Taskbar, select System

  2. Which brings up the drop menu for Lock Screen, about Gnome, System.

  3. On the second System drop menu select Sessions.

  4. Add instructions for Startup, I play a short login theme using mplayer.

In OpenSuse 11.2

Steps 1, 2 and 4 are the same.

Step 3 is instead of Sessions its called “Startup Applications”


Chillingout@opensuse.forum

I see you are using Gnome for this. I am using KDE and do not have such a System thing in the Taskbar. As the OP has not stated she/he is using Gnome I am not sure this will help him/her. The more because she/he asks for something to be done during boot, which is way before anybody logs in and thus way before either KDE or Gnome (or any other desktop) is started.

It is not even sure he/she uses a GUI in his/her system, because his question is valid even if the system runs in runlevel 3 only.

KDE it would be

Application Launcher>Configure Desktop (Personal Settings)>Advanced (tab)>Autostart>Add Script

create the script first, then add it using the method above.

Take Care,

Ian

Sorry, but no it wouldn’t. The OP’s question has nothing to do with things to be started for an end-user when she/he starts his desktop.
It is about the system doing something in the range of things that are done on going to a certain runlevel (3 or 5 in this case) during boot.

Nobody ever talked about a user loging in or a desktop started.

Please reread the thread from thh start and you will see that.

On 2010-07-03 17:40 GMT Chill Out wrote:

> In OpenSuse 11.1 :
>
> 1) On the Taskbar, select System
>
> 2) Which brings up the drop menu for Lock Screen, about Gnome, System.
>
> 3) On the second System drop menu select Sessions.
>
> 4) Add instructions for Startup, I play a short login theme using
> mplayer.
>
>
> In OpenSuse 11.2
>
> Steps 1, 2 and 4 are the same.
>
> Step 3 is instead of Sessions its called “Startup Applications”

That does not happen till you log in, and the OP asked about starting a
program at boot time.

It is very different.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Right, sorry. I guess I was thinking session start instead of boot time. I read Chill Out’s post and just figured I’d throw in what I thought was the KDE way. I guess the lack of the OP’s input didn’t really straighten things out for me either. I did read the whole thread. I’ll make sure not to post next time unless I’m completely sure what the thread’s about.

Take Care,

Ian

On Sat, 03 Jul 2010 19:16:02 +0000, hcvv wrote for a reply:

> ijbreakey;2184444 Wrote:
>> KDE it would be
>>
>> Application Launcher>Configure Desktop (Personal Settings)>Advanced
>> (tab)>Autostart>Add Script
>>
>> create the script first, then add it using the method above.
>>
>> Take Care,
>>
>> Ian
>
> Sorry, but no it wouldn’t. The OP’s question has nothing to do with
> things to be started for an end-user when she/he starts his desktop. It
> is about the system doing something in the range of things that are
> done on going to a certain runlevel (3 or 5 in this case) during boot.
>
> Nobody ever talked about a user loging in or a desktop started.
>
> Please reread the thread from thh start and you will see that.

Yes you’re right, OP did ask for boot time.

She/he could use /etc/init.d/rc with messy /etc/init.d/rc*.d/S99dsl0
just to “ifup dsl0”

That bothers me because this could/should be done by NetworkManager or /
etc/init.d/rc2(35).d/K07network?

Unless maybe the OP has multiple interfaces eth0 and after login needs to
ifup dsl0 or setup a dsl0 instead of eth0 in NetworkManager?


Chillingout@opensuse.forum

On 2010-07-02, colao <colao@no-mx.forums.opensuse.org> wrote:
>
> I do this every time.
>
> Code:
> --------------------
>
> ifup dsl0
>
> --------------------
>
> How can i set this to start at boot time?
>
>

You can add a boot-tim cron job with crontab -e?
The line would be:
@reboot /path/to/yourscript


When in doubt, use brute force.
– Ken Thompson

On 2010-07-04 18:17 GMT Chill Out wrote:

> Yes you’re right, OP did ask for boot time.
>
> She/he could use /etc/init.d/rc with
> messy /etc/init.d/rc*.d/S99dsl0 just to “ifup dsl0”

Mmm… never touch those links manually in a suse or opensuse install.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))