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-16-2007 04:54 AM

setting the processes to run on startup
 
hi everybody,

i have this small script for a backup software..

and there is a hint to make links like this..

i am using suse 10.2 and i don't have the directories rc0.d or rc1.d in /etc/init.d. I only have them as files..

can someone help how to deal with it? how can i create links..

another question is, in general, how can i place a process on linux-startup so that i runs after each restart?

thnaks..

larkl 10-16-2007 06:20 AM

I don't use SUSE, but you might try their forum...

http://forums.suselinuxsupport.de/in...howtopic=52444

selva146 10-16-2007 06:54 AM

in redhat and fedora, you can put the script command in /etc/rc.local file

each and every restart this file gets executed

marozsas 10-16-2007 06:57 AM

The links you provided are both unreachable (403 Forbidden), but in general, scripts to be executed at boot time are in /etc/init.d/ and symbolic links in /etc/rc3.d (for runlevel 3) or /etc/rc5.d (for runlevel 5). The links have a name that starts with "Snn" where the number indicates de order of execution relative to others in the same folder. There are links starting with "Knn" to stops the service in a particular order too.
For example, my e-mail server is Postfix and it is started in runlevel 5.
Code:

[root@agente86 ~]# ls -l /etc/init.d/postfix /etc/rc5.d/S80postfix
-rwxr-xr-x 1 root root 2401 2007-06-14 07:29 /etc/init.d/postfix
lrwxrwxrwx 1 root root  17 2007-06-13 09:51 /etc/rc5.d/S80postfix -> ../init.d/postfix
[root@agente86 ~]#

So, if you have a complex script, let say mybackup, put it on /etc/init.d and create links on /etc/rc5.d (or /etc/rc3.d) with a name like "S91mybackup". This script must be executable (-rwx) and it expects an argument "start|stop|status". If this script follows the LSB, you can use the command "chkconfig myscript on/off" to automatically create/destroy the links in the appropriate order and run-level.

If it is a simple script that does not expect a start/stop argument, or just a command, edit the file /etc/init.d/boot.local and add the command at end of this file.

laucian 10-18-2007 05:07 AM

thanks for your reply..
i have done what you have said..here is a terminal log which shows the actual state.

Code:

mfc-falter:~ # cd /etc/init.d/
mfc-falter:/etc/init.d # ps aux | grep dsmc
root      4149  0.0  0.5  22640  4948 ?        Sl  12:01  0:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      4244  0.0  0.0  4100  708 pts/0    S+  12:02  0:00 grep dsmc
mfc-falter:/etc/init.d # ./adsm stop
Stopping ADSM scheduler...
...stopped
mfc-falter:/etc/init.d # ps aux | grep dsmc
root      4252  0.0  0.0  4100  708 pts/0    S+  12:02  0:00 grep dsmc
mfc-falter:/etc/init.d # ./adsm start
Starting ADSM scheduler...
...started - done.
mfc-falter:/etc/init.d # ps aux | grep dsmc
root      4258  3.0  0.5  22636  4948 pts/0    Sl  12:02  0:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      4261  0.0  0.0  4100  708 pts/0    S+  12:02  0:00 grep dsmc
mfc-falter:/etc/init.d # cd rc3.d/
mfc-falter:/etc/init.d/rc3.d # ls -l K21adsm
lrwxrwxrwx 1 root root 7 Oct 16 12:26 K21adsm -> ../adsm
mfc-falter:/etc/init.d/rc3.d # cd ..
mfc-falter:/etc/init.d # cd rc5.d/
mfc-falter:/etc/init.d/rc5.d # ls -l K21adsm
lrwxrwxrwx 1 root root 7 Oct 16 12:26 K21adsm -> ../adsm
mfc-falter:/etc/init.d/rc5.d #


but after restart, there is no dsmc process which should be run by the adsm script.
i can start and stop manually but not on startup.
any ideas? adsm is already wrx for root.

thanks..

marozsas 10-18-2007 05:31 AM

Quote:

Originally Posted by laucian (Post 2928242)
but after restart, there is no dsmc process which should be run by the adsm script.
i can start and stop manually but not on startup.
any ideas? adsm is already wrx for root.

By "restart" I presume you talking about a reboot of this computer, right ?
I think this is because there is no file "/etc/rc5.d/S80adsm" where "S" means "start". You show us only the "K21adsm" file which will kill the process in that run-level.

Test if your adsm script is LSB compliant by running "chkconfig --list". If you get a output that shows in what levels it is on and what levels it is off, then you don't need to create the links by your self. Use chkconfig interface to do that: "chkconfig adsm off" (to remove all links you eventually have created) followed by "chkconfig adsm on" and another "chkconfig --list" to see in what levels it will be run.

If it not follows the "chkconfig" interface, remove all K21adsm links and create the "Snnadsm" links in runlevel 3 and 5. You need to carefully choose the right "nn" in a way the script will run only after the services it depends on are already started.

janardhan narra 10-18-2007 05:53 AM

I Went To Customer To Install Linux In New System But It Is Not Installing At Last I Had Found That The Harddesk Is With Sata Cable.
Why Sata Hdd Not Support To Lunix
Then How To Install This
While Installing The System Does Not Find Any Hdd Please Help Me What To Do

marozsas 10-18-2007 06:02 AM

Quote:

Originally Posted by janardhan narra (Post 2928265)
I Went To Customer To Install Linux In New System But It Is Not Installing At Last I Had Found That The Harddesk Is With Sata Cable.
Why Sata Hdd Not Support To Lunix
Then How To Install This
While Installing The System Does Not Find Any Hdd Please Help Me What To Do

Start your own thread (New Thread button on top of forum's page) to get the maximum visibility and provide as much information you can at the first post. Tell us what computer is (mobo manufacture, disk model, etc) and what distro are you using to install.

laucian 10-18-2007 07:51 AM

thanks marozsas,
yes i was meaning a system boot (reset)
i have done everything as you said, i ran chkconfig --list, level 3 and 5 were on.
with chkconfig adsm on/off i set the level on and off.

now here is a directory overview
Code:

mfc-falter:/etc/init.d/rc3.d # ls -l *adsm*
lrwxrwxrwx 1 root root 7 Oct 18 14:43 K21adsm -> ../adsm
lrwxrwxrwx 1 root root 7 Oct 18 14:43 S01adsm -> ../adsm

mfc-falter:/etc/init.d/rc3.d # ls -l *adsm*
lrwxrwxrwx 1 root root 7 Oct 18 14:43 K21adsm -> ../adsm
lrwxrwxrwx 1 root root 7 Oct 18 14:43 S01adsm -> ../adsm

i am unfortunately not in the office..i have done this remote..
i will post the results when i can make the reboot but i think it should work out..

can you explain me the magic behind the curtain? what does LSB mean? what are all those levels? S is start, K is kill..what other things more?

marozsas 10-18-2007 09:21 AM

Quote:

Originally Posted by laucian (Post 2928395)
thanks marozsas,
can you explain me the magic behind the curtain? what does LSB mean? what are all those levels? S is start, K is kill..what other things more?

LSB means "Linux Standard Base" and it is a set of conventions to make easier the administration tasks on a linux box, whatever the distro is.

For instance, an init script that follows this conventions have a small header that is used by chkconfig and fellows, to deal with the links in /etc/rc.d and runlevels. Postfix has the following header and as you can see, the information bellow informs the proper order and pre-requisites to this script.
Code:

#
# /etc/init.d/postfix
#
### 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

You can find more information on LSB's site.

And no, there is no other link type than the ones that start with "S" or "K".

Another convenience on SuSe are the rccommands - they are easy to type and to autocomplete by your shell:
In Suse, almost every init script can be start/stopped with the rccommands, i.e. rcpostfix start (or stop - there is also status and restart - in fact, is just a link from /sbin/rcpostfix to /etc/init.d/postfix - you can make the link yourself for adsm...)

In Redhat/Fedora, you can do the same with "service postfix start".
(I don't know if the above is under LSB conventions or not)

cheers,

laucian 10-23-2007 02:37 AM

i am sorry to say that but it did not work out..
it does not start after reboot..
i had to start it manually..

any further ideas?

marozsas 10-23-2007 05:19 AM

Please, give us the output of the following commands:
Code:

# runlevel
# cat /etc/issue
# chkconfig adsm
# chkconfig --list adsm
# ls -l /etc/init.d/adsm
# find /etc -type l -iname "*adsm"


laucian 10-23-2007 05:32 AM

before giving the outputs a quick question...

xinitrc file for the GUI responsible..
i mean the programs that i run via xinitrc file will be loaded only after i start KDE or GNOME..is this right?

laucian 10-23-2007 05:39 AM

Code:

mfc-falter:~ # runlevel
N 5

mfc-falter:~ # cat /etc/issue

Welcome to openSUSE 10.2 (X86-64) - Kernel \r (\l).


mfc-falter:~ # chkconfig adsm
adsm  on
mfc-falter:~ # chkconfig --list adsm
adsm                      0:off  1:off  2:off  3:on  4:off  5:on  6:off

mfc-falter:~ # ls -l /etc/init.d/adsm
-rwxr-xr-x 1 root root 1232 Oct 16 12:16 /etc/init.d/adsm
mfc-falter:~ # find /etc -type l -iname "*adsm"
/etc/init.d/rc5.d/K21adsm
/etc/init.d/rc5.d/S01adsm
/etc/init.d/rc3.d/K21adsm
/etc/init.d/rc3.d/S01adsm

and there is a modification that i have made..i think i should add that one here too..in this file,
Code:

mfc-falter:/etc/X11/xinit # ls -l xinitrc
-rwxr-xr-x 1 root root 1388 Oct 23 12:29 xinitrc

i just added..
Code:

#
# Add your own lines here...
#
/etc/init.d/adsm start


marozsas 10-23-2007 05:52 AM

Quote:

Originally Posted by laucian (Post 2933513)
before giving the outputs a quick question...

xinitrc file for the GUI responsible..
i mean the programs that i run via xinitrc file will be loaded only after i start KDE or GNOME..is this right?

no, not really. xinitrc run commands when the graphical mode starts, like the Graphical Display Manager, the login manager...

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


laucian 10-25-2007 07:50 AM

Code:

mfc-falter:/etc/init.d/rc3.d # runlevel
N 5

Code:

mfc-falter:/etc/init.d/rc3.d # find /etc/init.d -iname "*adsm" -ls
1266890    0 lrwxrwxrwx  1 root    root            7 Oct 25 09:50 /etc/init.d/rc5.d/K21adsm -> ../adsm
1266887    0 lrwxrwxrwx  1 root    root          16 Oct 25 12:30 /etc/init.d/rc5.d/S90adsm -> /etc/init.d/adsm
1266883    4 -rwxr-xr-x  1 root    root        1232 Oct 16 12:16 /etc/init.d/adsm
1266857    0 lrwxrwxrwx  1 root    root            7 Oct 25 09:50 /etc/init.d/rc3.d/K21adsm -> ../adsm
1265096    0 lrwxrwxrwx  1 root    root          16 Oct 25 14:39 /etc/init.d/rc3.d/S90adsm -> /etc/init.d/adsm


i think there is a problem here...

Code:

mfc-falter:/ # ps -ef | grep dsmc
root      4248  4183  0 14:44 pts/0    00:00:00 grep dsmc
mfc-falter:/ # /etc/init.d/rc5.d/S90adsm stop
 ADSM scheduler is not running.
mfc-falter:/ # /etc/init.d/rc5.d/S90adsm start
Starting ADSM scheduler...
...started - done.
mfc-falter:/ # ps -ef | grep dsmc
root      4261  4183  0 14:44 pts/0    00:00:00 grep dsmc
mfc-falter:/ # cd /etc/init.d/

so the link does not start the process (dsmc is the name of the process that adsm script starts)

but when i start it manually and directly (not using the Snn files)
Code:

mfc-falter:/etc/init.d # ./adsm start
Starting ADSM scheduler...
...started - done.
mfc-falter:/etc/init.d # ps -ef | grep dsmc
root      4305    1  1 14:45 pts/0    00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      4308  4183  0 14:45 pts/0    00:00:00 grep dsmc
mfc-falter:/etc/init.d #

is this command right?
Code:

ln -s /etc/init.d/adsm /etc/init.d/rc3.d/S90adsm
-s means making symbolic links instead of hard links here..what is the difference between them?

marozsas 10-25-2007 08:28 AM

Well, at least the adsm links are ok now.

The strange is "/etc/init.d/adsm start" works and "/etc/init.d/rc5.d/S90adsm start" not, even it says "Starting ADSM scheduler...started - done." :scratch:

I think the problem is not with the link anymore but with the script itself.

In your post #20, you put a section of "/etc/init.d/adsm start" that says it is a "script is designed for Debian Linux" but you are using a openSuSE system, right ?

Try to replace this debian script by an another one designed to SuSE. Check if there is a SuSE script in the package.

Or you may try this one: Novell Cool solutions

Make a copy of "/etc/init.d/adsm" in a safe place, just in case, and copy the new script over "/etc/init.d/adsm".

The SuSE script in the above link follows the LSB conventions to be used with chkconfig.
In this case, remove the links manually, and run "chkconfig adsm on; checkonfig --list adsm" and check if the proper links were created in the right places and position.

Try to run by the link again.

laucian 10-30-2007 04:44 AM

well i have replaced the script, set chkconfig adsm to off (which has deleted the links) .
Then i copied adsm to /etc/init.d/. set the file to mod 755.
then i made chkconfig adsm on..
the script was on levels 3 on 5 on. but it still did not start on the boot..

here is a log of the terminal
Code:

mfc-falter:~ # chkconfig -l adsm
adsm                      0:off  1:off  2:off  3:on  4:off  5:on  6:off
mfc-falter:~ # ps -ef | grep adsm
root      4170  4162  0 10:40 pts/2    00:00:00 grep adsm
mfc-falter:~ # find /etc/ -name "*adsm"
/etc/adsm
/etc/init.d/rc5.d/S09adsm
/etc/init.d/rc5.d/K13adsm
/etc/init.d/adsm
/etc/init.d/rc3.d/S09adsm
/etc/init.d/rc3.d/K13adsm
mfc-falter:~ # cd /etc/init.d/
mfc-falter:/etc/init.d # ls -l ads*
-rwxr-xr-x 1 root root 1777 Oct 30 10:22 adsm
-rwxr-xr-x 1 root root 1232 Oct 16 12:16 adsm_backup


marozsas 10-30-2007 05:57 AM

What you have done so far:
1) fixed the init script by the correct one, for SuSE systems.
2) fixed the links in the runlevels to run the init script at the right time (S09)

Now we have to find the reason it not start by look for messages in log files.

If you are using the init script provided by Novell Coll Solutions try to edit the section that call dsmc binary and change the null re-direction to a log file in /tmp instead.
Change from:
Code:

    echo -n $"Starting $prog2: "
    startproc -f -p $DSMC_PIDFILE $DSMC_BIN sched >/dev/null 2>/dev/null
    rc_status -v
    echo -n $"Starting $prog1: "
    startproc -f -p $DSMCAD_PIDFILE $DSMCAD_BIN  >/dev/null 2>/dev/null
    rc_status -v

to:
Code:

    LOG="/tmp/adsm-init.log"
    rm -f $LOG
    date > $LOG
    echo "before start $prog2" >>$LOG
    echo "the start cmd is: $DSMC_PIDFILE $DSMC_BIN sched" >>$LOG
    echo -n $"Starting $prog2: "
    startproc -f -p $DSMC_PIDFILE $DSMC_BIN sched >>$LOG 2>>$LOG
    rc_status -v
    echo "before start $prog1" >>$LOG
    echo "the start cmd is: $DSMCAD_PIDFILE $DSMCAD_BIN" >>$LOG
    echo -n $"Starting $prog1: "
    startproc -f -p $DSMCAD_PIDFILE $DSMCAD_BIN  >>$LOG 2>>$LOG
    rc_status -v

After the boot, try to find the reason it is not starting by inspecting the log files "/var/log/messages" and "/tmp/adsm-init.log".
At boot time try to see if there are messages in console, it may help you too.

laucian 10-30-2007 06:19 AM

before we try it with the script from novell a quick question..

in msdos there is this autoexec.bat..i have made a search for its linux relevant and i have landed on /etc/init.d/boot.local file (on suse)

when i run this command on console
Code:

mfc-falter:/ # /etc/init.d/adsm start
Starting ADSM scheduler...
...started - done.

but then occurs the problem..
Code:

mfc-falter:/ # ps -ef | grep dsmc
root      4007  3969  0 12:15 pts/0    00:00:00 grep dsmc

there is no process..

then i try out smt. like this..

Code:

mfc-falter:/ # cd /etc/init.d/
mfc-falter:/etc/init.d # ./adsm start
Starting ADSM scheduler...
...started - done.
mfc-falter:/etc/init.d # ps -ef | grep dsmc
root      4062    1  1 12:17 pts/0    00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      4065  3969  0 12:17 pts/0    00:00:00 grep dsmc

and voila..this is what i need..but how can i place it boot.local?
what is the difference between these two commands?
should i really use cd command in a script file?

laucian 10-30-2007 06:31 AM

ok now it works..i believe i have "technically" what i wanted..please correct me if i am wrong..

Code:

mfc-falter:~ # ps -ef | grep dsmc
root      2427    1  0 12:22 ?        00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      3897  3878  0 12:23 pts/0    00:00:00 grep dsmc
mfc-falter:~ # chkconfig --list adsm
adsm                      0:off  1:off  2:off  3:off  4:off  5:off  6:off
mfc-falter:~ # who -r
        run-level 5  Oct 30 12:22                  last=S
mfc-falter:~ # init 3
mfc-falter:~ # ps -ef | grep dsmc
root      2427    1  0 12:22 ?        00:00:00 /opt/tivoli/tsm/client/ba/bin/dsmc schedule
root      4020  3878  0 12:26 pts/0    00:00:00 grep dsmc

but there is the funny part of this..

first of all, the boot.local file;
Code:

# /etc/init.d/boot.local
#
# script with local commands to be executed from init on system startup
#
# Here you should add things, that should happen directly after booting
# before we're going to the first run level.
#
echo myadsm
cd /etc/init.d/
./adsm start
echo myadsm2

then /var/log/boot.msg file
Code:

myadsm
Starting ADSM scheduler...
...started - done.
myadsm2

i will now remove the myadsm and myadsm2 lines..but why do i need the cd command?

marozsas 11-01-2007 07:20 AM

Quote:

Originally Posted by laucian (Post 2942042)

and voila..this is what i need..but how can i place it boot.local?
what is the difference between these two commands?
should i really use cd command in a script file?

In my post #4 I have mentioned /etc/init.d/boot.local as the place to put simple commands to be started just before the machine ends the boot process.

You can, for sure, put any commands in boot.local. The difference is it is not under the control of chkconfig so, you need to manually edit the file to activated or not the command in the next boot. In fact, the very first versions of unix/linux didn't have any other boot script but only a simple file where all commands are in, just like boot.local. In fact, even in nodays there are very tiny/small versions of unix-like system that have only one script executed at boot time, full of commands.

In fact, nothing changed at all. After kernel is up it calls the process /sbin/init that calls the script /etc/init.d/boot. This script will call every /etc/init.d/rcN.d/Snnwhatever and after that /etc/init.d/boot.local.



Quote:

Originally Posted by laucian (Post 2942042)
then i try out smt. like this..

I sorry, I can't figure out what you mean by "try out smt" ?

marozsas 11-01-2007 08:38 AM

Congratulations !


Quote:

Originally Posted by laucian (Post 2942053)
ok now it works..i believe i have "technically" what i wanted..please correct me if i am wrong..
...
i will now remove the myadsm and myadsm2 lines..but why do i need the cd command?

Man... I think it is a bug in the adsm script. For some reason it depends on the current directory....

Just to be sure, add the cd command at the beginning of adsm script, and remove it from boot.local and restore it via chkconfig. If it works, than it is really a bug - it runs only if the current dir is /etc/init.d/ for some reason....


best regards,


All times are GMT -5. The time now is 05:16 AM.