LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting the processes to run on startup (https://www.linuxquestions.org/questions/linux-newbie-8/setting-the-processes-to-run-on-startup-592180/)

laucian 10-23-2007 05:59 AM

i have compared the runlevels of adsm script with sshd and cupsd..
they are the same..
so the adsm should be started at the same level..
what could be wrong..?

i could start the script manually..

marozsas 10-23-2007 06:17 AM

I am guessing, but looks like the order for this adsm program is wrong. S01 is too soon; you don't have networking at this point, for instance.
If the program does not have the necessary pre-requisites it will fail at startup, but after the system boots up completely, it can run just fine.

What this adsm program is supposed to do ? Where you have downloaded it ? How do you install this program ? By a rpm or a tar (configure;make;make install) ?

Please, put the lines beetween ### BEGIN INIT INFO and ### END INIT INFO of the /etc/init.d/adsm so we can propose a better order for it.

laucian 10-24-2007 07:58 AM

this adsm script is supposed to start the scheduler of "ibm tivoli backup sofware". It is written by the university of heidelberg where i work as a part-time student.

Quote:

Please, put the lines beetween ### BEGIN INIT INFO and ### END INIT INFO of the /etc/init.d/adsm so we can propose a better order for it.
i don't understand this part..what should it put between the lines?
i don't have these lines (###BEGIN INIT INFO etc..) in adsm script..

marozsas 10-24-2007 08:24 AM

Quote:

Originally Posted by laucian (Post 2934904)
i don't understand this part..what should it put between the lines?
i don't have these lines (###BEGIN INIT INFO etc..) in adsm script..

Ohh, I'm sorry, I want to see a few lines from the initial section of the file /etc/init.d/adsm from the line ###BEGIN INIT INFO until the line ### END INIT INFO

For instance, /etc/init.d/postfix has the lines:
Code:

### BEGIN INIT INFO
# Provides:      sendmail postfix
# Required-Start: $network $named $syslog $time
# Should-Start: cyrus ldap ypbind openslp
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:    start the Postfix MTA
### END INIT INFO

An init script may have the following header too: (from /etc/init.d/anacron)
Code:

#
# chkconfig: 2345 95 05
# description: Run cron jobs that were left out due to downtime
# pidfile: /var/run/anacron.pid

Or it may have not the lines at all (!!) - I believe it is the case, since chkconfig created the links at S01 position.....

Anyway, you need to change when this script starts. Currently it starts at very beginning of runlevel 5 (S01) and I suggest you change it to start a bit later. In the above notation, anacron starts at position S95 of run levels 2, 3, 4 and 5 and ends at position K05 of the same levels. If your script follows that convention, edit it and change the position to S90 or something like that. run "chkconfig adsm off" before you edit the file, and "chkconfig adsm on" after you have edited it. Check the position of the links Snnadsm.

If not, make the links manually:
Code:

# rm /etc/init.d/rc5.d/S01adsm /etc/init.d/rc3.d/S01adsm
# ln -s /etc/init.d/adsm /etc/init.d/rc5.d/S90adsm
# ln -s /etc/init.d/adsm /etc/init.d/rc3.d/S90adsm

I hope you manage to fix this now.

laucian 10-24-2007 09:07 AM

Code:

mfc-falter:~ # find /etc -name "*adsm"
/etc/adsm
/etc/init.d/adsm
/etc/init.d/rc3.d/S90adsm

so i changed the settings like this but it still does not work..

in /var/log/boot.msg i search for string "adsm" . It could not be found.

script has only these lines..

Code:

#!/bin/sh
# ADSM Script
# to start / stop the ADSM Scheduler
# for automated backups of the client
# script is designed for Debian Linux
# Nov 22, 2006, add:
# include setting of "locale" to backup "Umlaute"
# and IFS

i will try the same with level 2 and post again..

laucian 10-24-2007 09:14 AM

level 2 did not help..

when the adsm script is run, is gives outputs like "adsm is already running" or "adsm is started" etc..is there any log file in which this could be written so that i can read?

laucian 10-24-2007 09:26 AM

NEW INFO HAS COME TO LIGHT!!!

Usage: /etc/init.d/ADSM {start|stop|restart}

this was in the /var/log/boot.msg file..

mfc-falter:/etc/init.d/rc2.d # ./S21adsm
Usage: /etc/init.d/ADSM {start|stop|restart}


i need some sort of an start parameter..how can i add it to the adsm script?

marozsas 10-24-2007 09:57 AM

Quote:

Originally Posted by laucian (Post 2935023)

i need some sort of an start parameter..how can i add it to the adsm script?

You don't.
Every script at /etc/init.d/rcn.d/S* is called to run as "/etc/init.d/rcn.d/Snnwhatever start"

...still thinking...

marozsas 10-24-2007 10:01 AM

Quote:

Originally Posted by laucian (Post 2935000)
Code:

mfc-falter:~ # find /etc -name "*adsm"
/etc/adsm
/etc/init.d/adsm
/etc/init.d/rc3.d/S90adsm


If your current run level is 5 (test with runlevel command) them thre is no /etc/init.d/rc5.d/S90adsm link ! From the above, there is a link only for run level 3.

Create the link at /etc/init.d/rc5.d/S90adsm and I bet this time it will work. From my previous post there is a instruction to create the link at rc5.d, check it if necessary.

marozsas 10-24-2007 10:07 AM

Quote:

Originally Posted by laucian (Post 2935009)
level 2 did not help..

Stays at runlevel 3 or 5. They are the default run levels and I can't be sure if anything else will work at levels 2 or 4, unless you heavily tuned your system to do that.

laucian 10-25-2007 02:30 AM

there were links on levels 3 and 5 but they didn't work. That's why i tried to place the links on the second level..

But now i know the problem..the script needs and start argument to start. As i posted in #22..i just don't know how to automate it with the start argument..

marozsas 10-25-2007 05:17 AM

Quote:

Originally Posted by laucian (Post 2936050)
there were links on levels 3 and 5 but they didn't work. That's why i tried to place the links on the second level..

Are you sure ? Based on what you post in #20, there is no link for level 5.
Double check.

Quote:

Originally Posted by laucian (Post 2936050)
But now i know the problem..the script needs and start argument to start. As i posted in #22..i just don't know how to automate it with the start argument..

As I said in #23, the scripts that starts with a "Snn" in /etc/init.d/rc5.d (or rc3.d) are called with a "start" argument - this is done automatically.

So I think is just a matter of create a link a run level 5. The command "ln -s /etc/init.d/adsm /etc/init.d/rc5.d/S90adsm" should work.

laucian 10-25-2007 05:27 AM

Quote:

Originally Posted by marozsas (Post 2936182)
Are you sure ? Based on what you post in #20, there is no link for level 5.
Double check.

i had changed it several times, this is now the final state

mfc-falter:/etc/init.d # chkconfig -l adsm
adsm 0:off 1:off 2:off 3:on 4:off 5:on 6:off
mfc-falter:/etc/init.d # find /etc -name "*adsm"
/etc/adsm
/etc/init.d/rc5.d/K21adsm
/etc/init.d/rc5.d/S01adsm
/etc/init.d/adsm
/etc/init.d/rc3.d/K21adsm
/etc/init.d/rc3.d/S01adsm

Quote:

As I said in #23, the scripts that starts with a "Snn" in /etc/init.d/rc5.d (or rc3.d) are called with a "start" argument - this is done automatically.

oh sorry, i missed that part..

Quote:

So I think is just a matter of create a link a run level 5. The command "ln -s /etc/init.d/adsm /etc/init.d/rc5.d/S90adsm" should work.
so i will try this right away..

laucian 10-25-2007 05:36 AM

mfc-falter:/etc/init.d # ln -s /etc/init.d/adsm /etc/init.d/rc5.d/S90adsm
mfc-falter:/etc/init.d # rm /etc/init.d/rc5.d/S01adsm


mfc-falter:/etc/init.d # find . -name "*adsm"
./rc5.d/K21adsm
./rc5.d/S90adsm
./adsm
./rc3.d/K21adsm
./rc3.d/S01adsm


with these settings, it does not start after reboot..do i have the right to go out of my mind? :scratch:

marozsas 10-25-2007 06:00 AM

Quote:

Originally Posted by laucian (Post 2936193)
with these settings, it does not start after reboot..do i have the right to go out of my mind? :scratch:

What is your current run level ? (run "runlevel" commmand as root).

You left a "/etc/init.d/rc3.d/S01adsm" behind. remove it and re-create the link in runlevel 3 in the proper position with "ln -s /etc/init.d/adsm /etc/init.d/rc3.d/S90adsm". If your current run level is 3 this is why it not worked at run level 3. And as I said in a previous post, stay away from runlevels 2 and 4.

before you boot your machine, give me the output of the following commands:
Code:

# runlevel
# find /etc/init.d -iname "*adsm" -ls

and
Code:

# /etc/init.d/rc5.d/S90adsm stop
# /etc/init.d/rc5.d/S90adsm start



All times are GMT -5. The time now is 04:34 AM.