Linux.com

Author Message
Joined: Mar 09, 2009
Posts: 2
Other Topics
Posted Mar 14, 2009 at 10:14:10 AM
Subject: 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 # 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 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 Question ------------ Please help, where I am doing wrong ? or is it a bug ? why SUSE executes/runs "/etc/init.d/mountfs" before "/etc/init.d/open-iscsi" following are the startup/boot messages on the console that shows that "mountfs" runs before the iSCSI initiator service INIT: Entering runlevel: 3 Boot logging started on /dev/tty1(/dev/console) at Sat Mar 14 01:26:28 2009 Master Resource Control: previous runlevel: N, switching to runlevel: 3 Starting D-BUS daemon done Initializing random number generator done mounting LUN(SAN disk): mount: special device /dev/sda1 does not exist failed Checking/updating CPU microcode done Starting irqbalance done Starting resource manager done Starting HAL daemon done Setting up network interfaces: lo lo IP address: 127.0.0.1/8 Checking for network time protocol daemon (NTPD): doneed eth0 eth0 configuration: eth-id-00:16:3e:79:12:bd eth0 (DHCP) . IP/Netmask: 192.168.0.233 / 255.255.255.0 done Setting up service network . . . . . . . . . . . . . . . . done Starting SSH daemon done Starting iSCSI initiator service: Starting syslog services done done Attempting discovery on target at 192.168.0.6: done Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2009-03.net.test:3674d885-0b1e-4e30-a4bd-378e38fb1a93, portal: 192.168.0.6,3260] Login to [iface: default, target: iqn.2009-03.net.test:3674d885-0b1e-4e30-a4bd-378e38fb1a93, portal: 192.168.0.6,3260]: successful done Master Resource Control: runlevel 3 has been reached Failed services in runlevel 3: mountfs Skipped services in runlevel 3: splash # cat /etc/init.d/mountfs #!/bin/bash # # /etc/init.d/mountfs # ### BEGIN INIT INFO # Provides: mountfs # Required-Start: $network $remote_fs $iscsi $netdaemons # Should-Start: # Required-Stop: # Should-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: mounts /dev/sda1(san disk) on /dir # ### END INIT INFO . /etc/rc.status rc_reset case "$1" in start) echo -n "mounting LUN(SAN disk): " /bin/mount /dev/sda1 /data rc_status -v ;; stop) echo -n "Unmounting the LUN(SAN disk): " /bin/umount /dev/sda1 rc_status -v ;; restart) $0 stop $0 start ;; status) echo -n "Checking the mount state of LUN(san disk)" /bin/mount | grep -e "/dev/sda1 on /data" rc_status -v ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac rc_exit
Back to top Profile Email Website
needee
Joined Mar 09, 2009
Posts: 2

Other Topics
Posted: Mar 14, 2009 10:35:02 AM
Subject: runlevel script, runs in wrong order
why the post is unreadable ?
Back to top Profile Email Website
Reed
Joined Feb 07, 2008
Posts: 758

Other Topics
Posted: Mar 14, 2009 12:53:56 PM
Subject: runlevel script, runs in wrong order
The formatting here has been messed up for a while, and it doesn't look like it will be fixed before the new linux.com reopens. For posts like this I suggest trying www.linuxforums.org/forum
Back to top Profile Email Website
pp1212
Joined Mar 15, 2009
Posts: 36

Other Topics
Posted: Apr 28, 2009 9:58:39 AM
Subject: runlevel script, runs in wrong order
Back to top Profile Email Website
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya