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-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 04:46 AM.