Autostart software

How to make a software starts automatically every boot? Note that this software needs root privelliage

It would help if we had some clue as to what you had in mind?!

caf4926 wrote:
> It would help if we had some clue as to what you had in mind?!

right…

“wizardslovak”, do you want it running if you boot to KDE? Gnome? neither?
either? always?

and, by “always” do you mean maybe you are running a headless server without
running X??


DenverD (Linux Counter 282315)
A Texan in Denmark

Starting at boot (on reaching a particular run level) is done by scripts in /etc/init.d.

When it is a only simple thing to do you could put a few lines in /etc/init.d/boot.local (and when you need to stop properly, also in halt.local).

For really adding an application/deamon start/stop to your system look in the scripts in /etc/init.d for examples. The structure of the start, stop, etc. sections is important. As is the handling of return codes. And if you carefully format the comment lines in the beginning (as the examples show), you can then, after creation of the script, go to YaST > System > System Services (runlevel) and switch your app on/off there.

If on the other hand you are just looking to run a program with user startup that requires root privilege, that is possible from KDE ~./kde/Autostart. (In KDE4, there is an Autostart module in Configure Desktop, btw). I once ran a script which ran several utilities which required root that way, configuring sudo for those commands only.

I use KDE 3.5. I want to start macchanger automatically, so I can change my NIC’s MAC automatically. I have made a script located in /etc/init.d/ named start_macchanger. Now, how to make it runs automatically every boot?

Hi
Look at the /etc/init.d/skeleton file, this is the template to use for
these sorts of scripts to suse-fy them. Then if all is well run the
following to turn on;


chkconfig <name_of_your-script> on


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.11-0.1-default
up 14:56, 3 users, load average: 0.14, 0.25, 0.24
GPU GeForce 6600 TE/6200 TE - Driver Version: 173.14.12

On Sat, 16 Aug 2008 02:46:05 GMT
ba tux <ba_tux@no-mx.forums.opensuse.org> wrote:

>
> I use KDE 3.5. I want to start macchanger automatically, so I can change
> my NIC’s MAC automatically. I have made a script located in /etc/init.d/
> named start_macchanger. Now, how to make it runs automatically every
> boot?
>
>

Ok, script named “start_macchanger”…

(as root)

cd /etc/init.d
ln -s start_macchanger rc3.d/S90_start_macchanger
ln -s start_macchanger rc5.d/S90_start_macchanger

This will cause it to automatically start for both runlevels 3 and 5, the
usual runlevels where it’d be useful.

I just realized it would likely be more useful to have changed the MAC
before you set up the network and query for a dhcp lease… so the
following would be better:

cd /etc/init.d
ln -s start_macchanger rc3.d/S04_start_macchanger
ln -s start_macchanger rc5.d/S04_start_macchanger

Since the network is brought up at S05_network… this should change the MAC
prior to the network coming up.

I think you’re going to have issues though, as the HAL system monitors MAC
addresses to see if you’ve installed any new hardware. I imagine that EVERY
time you boot, you’ll have to reinstall / reconfigure your network setup,
since it will see new cards every time the MAC changes. Might not be pretty.

As Malcolm mentioned, you really should use the skeleton file found
in /etc/init.d/skeleton to create init.d scripts, as this makes them conform
to a standard, making administration and maintenance VERY much easier.

The file is extensively commented and very helpful.

{Grin} I still don’t think changing your MAC is going to be pretty…
(and you’d still be findable… How’s Hawaii?)

Loni


L R Nix
lornix@lornix.com