LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 11-11-2005, 12:02 AM   #1
usaf_sp
Member
 
Registered: Jul 2005
Location: Tennessee
Distribution: openSUSE
Posts: 419

Rep: Reputation: 30
Run Script at Startup??


I would like to run a script at start up. I am confused with the documents I have read, perhaps someone would be kind and help me with this.

I would like to run AntiVir, but the dazuko module will not start and therefore the AvGuard service gets skipped during start up.

I need the following script run during startup:

Code:
#!/bin/bash
mount -o loop -t iso9660 /ISO/SUSE10DVD.ISO /mnt/susedvd
modprobe dazuko
/usr/lib/AntiVir/avguard start

This script should be run root. What I am trying to do is mount the DVD Iso so I don't have to keep the DVD in the drive for YaST. Since I do this everytime, it would be logical to start the AntiVir processes as well.

Does anyone have any suggestions?
 
Old 11-11-2005, 02:17 AM   #2
Neverendingo
Member
 
Registered: Dec 2004
Location: Dortmund, Germany
Distribution: Kubuntu 6.10 Edgy Eft
Posts: 33

Rep: Reputation: 15
Hello!

In /etc/init.d/boot.local you can write your instructions, so they are executed as root, at nearly the end of the bootup-process.
(if this file still exists in SuSE 10)

Greetings,
Ingo
 
Old 11-11-2005, 12:11 PM   #3
usaf_sp
Member
 
Registered: Jul 2005
Location: Tennessee
Distribution: openSUSE
Posts: 419

Original Poster
Rep: Reputation: 30
Thanks worked like a charm.

Curious though: Just before the system switches to runlevel 5 the same error about AVGuard not being loaded. AVGuard was loaded and a check of the status from the command line shows that it is running with 4 daemons. The daemons can not load without dazuko, so I know it is working. Why does linux do this? Doesn't it check running processes before going to runlevel 5?

And since I am new to this level of OS manipulation, could you explain what I just did? It might help me not to ask so many questions.

Better yet is there a reference I can read to learn more?

Last edited by usaf_sp; 11-11-2005 at 12:13 PM.
 
Old 11-11-2005, 12:27 PM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
Alternatively, you can use /etc/sysconfig/kernel MODULES_LOADED_ON_BOOT="dazuko" to have the module loaded.
It seems as if AVGuard is started properly by the script in /etc/init.d, but fails if the module is not loaded. Having the command in boot.local as well, causes double starts of the daemon (but 4 times???).

I suggest to look at the YaST runlevel editor and recommend to read chapter 28.2. "The init Process" of the SUSE admin guide.
 
Old 11-11-2005, 01:07 PM   #5
usaf_sp
Member
 
Registered: Jul 2005
Location: Tennessee
Distribution: openSUSE
Posts: 419

Original Poster
Rep: Reputation: 30
The reason there are 4 daemons is because AntiVir distributes the scanning to lessen the overhead. At least that is what it said in the install script. I think this is because I share files on this computer and it is giving a little chunk of the scanning process to each daemon to prevent one computer from dominating the process or thread. That way other computers do not have to wait unitl the client is done with the process before they can access another file. Parallel programming, I think. AntiVir does not appear to slow my computer down too much. Still faster than norton in windows, but necessary to combat Win32 viruses on my shares.

I tried loading the module at the kernel level, but that did not work. The instructions I found on Dazuko's website was for SuSe 9.3, not sure why it does not work here. The script accomplishes what I need. Albeit that it may not be the smoothest fix, but it works and gives me an opportunity to apply other settings from a single script.

What I did was execute another script from /etc/init.d/boot.local:

sh /home/boot/SuseBoot.sh

That way if I need other scripts, I can add them to the same directory without having to search for them. Kind of like adding a class library to the program directory in Visual Studio. One change in one place. I have a feeling that my scripting will only get more and more complicated as time goes by and it is better to get organized from the begining. Right?

Last edited by usaf_sp; 11-11-2005 at 01:12 PM.
 
Old 11-11-2005, 01:43 PM   #6
Neverendingo
Member
 
Registered: Dec 2004
Location: Dortmund, Germany
Distribution: Kubuntu 6.10 Edgy Eft
Posts: 33

Rep: Reputation: 15
Nice Thought!
 
  


Reply



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
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
get a script to run on startup kram Debian 3 04-23-2005 02:23 PM
'run as' from rc.5 startup script davee Linux - General 2 03-10-2005 02:36 AM
Run a script at startup iain.ross Linux - Newbie 8 08-27-2004 04:03 PM
How to run script on startup Angelis Linux - General 1 11-16-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:15 PM.

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
Open Source Consulting | Domain Registration