System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

runlevel script, runs in wrong order

Maaz
Valued Contributor

runlevel script, runs in wrong order

iSCSI-initiator(client) OS: SLES 10 SP2 x864

on iSCSI-initiator, when system boots/starts, /dev/sda(iSCSI LUN) is visible/accessible/available
# lsscsi
[0:0:0:0] disk IET VIRTUAL-DISK 0 /dev/sda

# fdisk -l /dev/sda

Disk /dev/sda: 5379 MB, 5379268608 bytes
166 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 10292 * 512 = 5269504 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 1020 5248889 83 Linux


on iSCSI-initiator /etc/init.d/mountfs(attached) is a script, that mounts /dev/sda1(iSCSI LUN) on /data

# chkconfig mountfs on
# chkconfig --list mountfs
# chkconfig --list mountfs
mountfs 0:off 1:off 2:off 3:on 4:off 5:on 6:off

# ls -l /etc/init.d/rc3.d/S05network
lrwxrwxrwx 1 root root 10 Mar 12 01:19 /etc/init.d/rc3.d/S05network -> ../network

# ls -l /etc/init.d/rc3.d/S06open-iscsi
lrwxrwxrwx 1 root root 13 Mar 13 2009 /etc/init.d/rc3.d/S06open-iscsi -> ../open-iscsi

# ls -l /etc/init.d/rc3.d/S11mountfs
lrwxrwxrwx 1 root root 10 Mar 14 2009 /etc/init.d/rc3.d/S11mountfs -> ../mountfs

when I manually run "/etc/init.d/mountfs start", the script mounts /dev/sda1 on /data
when I manually run "/etc/init.d/mountfs stop", the script unmounts /dev/sda1

Problem
--------
on system startup/boot "/etc/init.d/mountfs" fails to run automatically with the following message on console

mounting LUN(SAN disk): mount: special device /dev/sda1 does not exist
failed

Reason
------
on system startup/boot, OS(SUSE) runs the script(/etc/init.d/mountfs) before starting/running the iSCSI initiator service, thats why(I think) "/etc/init.d/mountfs" doesnt able access/mount /dev/sda1


Please help, where I am doing wrong ? or is it a bug ?

attached is the script, and console messages(that shows the startup order of scripts)
2 REPLIES
smatador
Honored Contributor

Re: runlevel script, runs in wrong order

Hi,

What about chkconfig --list open-iscsi ?
In the console message the mountfs appear first, it should be after the open-iscsi.
Put the open-isci first and the mountfs at the end.
On the script of mountfs
Required-Start: $network $remote_fs $iscsi $netdaemons
Maaz
Valued Contributor

Re: runlevel script, runs in wrong order

Hi smatador , thanks for the response/reply

> What about chkconfig --list open-iscsi ?
# chkconfig --list open-iscsi
open-iscsi 0:off 1:off 2:off 3:on 4:off 5:on 6:off

open-iscsi(iSCSI initiator Service) is running in runlevel 3 and 5, thats why I can see the iSCSI LUN

# lsscsi
[0:0:0:0] disk IET VIRTUAL-DISK 0 /dev/sda

# fdisk -l /dev/sda

Disk /dev/sda: 5379 MB, 5379268608 bytes
166 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 10292 * 512 = 5269504 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 1020 5248889 83 Linux

> On the script of mountfs
Required-Start: $network $remote_fs $iscsi $netdaemons

I did as you told, but still the script(mountfs) runs before the iSCSI initiator Service

any how I got another good(dirty) solution/workaround, but I am still testing it. I will let the forum know about the solution/workaround very soon

Regards