System hangs after running rc.S - Slackware

This is a discussion on System hangs after running rc.S - Slackware ; Hi, I have a strange problem here. I tared up the complete filesystem of a machine and copied it to a testing machine. After that I booted in via install CD and untared all the stuff to the new harddrive ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: System hangs after running rc.S

  1. System hangs after running rc.S

    Hi,
    I have a strange problem here.
    I tared up the complete filesystem of a machine and copied it to a
    testing machine.
    After that I booted in via install CD and untared all the stuff to the
    new harddrive and issued lilo with -r to install the boot loader.
    Everything went just fine to this point.
    But now the trouble begins.
    The system boots up just fine, I select the kernel, it starts the kernel
    init stuff and after that init executes /etc/rc.d/rc.S but after
    executing that simply stops. It just sits there doing nothing.
    It does not start any console mentioned in /etc/inittab, it does not
    start runlevel 2,3,4 no matter which default runlevel I tell it in inittab.
    I'm totally lost on this one.
    I know for sure that rc.S runs completely as I've put several echo
    statements in that script to show me the progress of the script.
    Did anyone of you guys ever had a similar problem?
    I'm really lost in how to tackle this problem.
    System is Slackware 10.2 which I want to upgrade on that testing machine
    before upgrading the life system.

    thanks for any help in advance
    Chris

  2. Re: System hangs after running rc.S

    Christian "Xtra" Schiffler wrote:
    > Did anyone of you guys ever had a similar problem?
    > I'm really lost in how to tackle this problem.
    > System is Slackware 10.2 which I want to upgrade on that testing machine
    > before upgrading the life system.


    Well, no one has had any real advice yet. The only thing I can say is
    I have a vague memory of someone having a line in a startup script that
    began with a './' instead of just '/' when executing a command that for
    some reason caused the script to just exit. I wish I could remember the
    subject - I'd probably be able to google it up easy enough.

    - Kurt

  3. Re: System hangs after running rc.S

    It had nothing to do with the script itself.
    After some more testing (booting into the system via ini=/bin/bash and
    executing the startup scripts by hand), I found out the old udev was
    unable to detect any tty/pty on the testing machine.
    This resulted in loosing all terminals (along with several other devices).
    I have no clue why it was like that but after upgrading udev to the
    slack12.1 contained version I was able to boot in just normal and do the
    rest of the upgrade.

    Very strange issue though.
    - Chris

  4. Re: System hangs after running rc.S

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On 2008-06-04, ~kurt wrote:
    > I have a vague memory of someone having a line in a startup script that
    > began with a './' instead of just '/' when executing a command that for
    > some reason caused the script to just exit.


    Close, but no cigar.

    Many of the init scripts in Slackware source other init scripts and
    they do so thusly:

    # Start Apache web server:
    if [ -x /etc/rc.d/rc.httpd ]; then
    . /etc/rc.d/rc.httpd start
    fi

    In this case, rc.httpd is included as part of the calling script (in
    this case, rc.M). The problem occurs when sysadmins do this with their
    own custom scripts that include an exit command. Example:

    #rc.foo
    if [ -x /usr/sbin/foo ]; then
    /usr/sbin/foo
    elif
    exit
    fi

    In this case, if some one were to say, edit rc.M and source rc.foo, all
    of rc.M would quite running if /usr/sbin/foo was not executable for
    some reason.

    The proper way when doing something along those lines, is not to source
    the script but simply to call it directly.

    .. /etc/rc.d/rc.foo # bad if rc.foo contains an explicit termination
    /etc/rc.d/rc.foo # good if rc.foo contains an explicit termination

    Savy?

    - --
    It is better to hear the rebuke of the wise,
    Than for a man to hear the song of fools.
    Ecclesiastes 7:5
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkhGupUACgkQrZS6hX/gvjoPsQCglvSvC8e7IRi2zpvDbfzf9Smw
    5nEAmgKXM0f9fyacXz/HZBn+LTXbhepX
    =BDJe
    -----END PGP SIGNATURE-----

  5. Re: System hangs after running rc.S

    On 2008-06-04, ~kurt wrote:
    > Christian "Xtra" Schiffler wrote:
    >> Did anyone of you guys ever had a similar problem?
    >> I'm really lost in how to tackle this problem.
    >> System is Slackware 10.2 which I want to upgrade on that testing machine
    >> before upgrading the life system.

    >
    > Well, no one has had any real advice yet. The only thing I can say is
    > I have a vague memory of someone having a line in a startup script that
    > began with a './' instead of just '/' when executing a command that for
    > some reason caused the script to just exit. I wish I could remember the
    > subject - I'd probably be able to google it up easy enough.



    I believe you're thinking sourcing a file from another; IOW, you
    could do this:
    source /some/file
    or:
    . /some/file

    That's roughly equivalent to an include statement in C, i.e.
    #include "/some/file"

    For clarity's sake, the 'source' command inserts the contents of the
    sourced file into the calling file at whatever location the sourcing
    was done. For example:

    _script.sh:_ _/some/file_ _RESULT:_
    #!/bin/sh echo middle #!/bin/sh
    echo begin exit 0 echo begin
    .. /some/file echo middle
    echo end exit 0
    echo end

    Note that because of the "exit 0" in the resulting commands to be
    executed, the "end" will never been seen. I used the "exit 0"
    example here because quite a few pure SysV init scripts have that
    in them.

    In case it's not obvious to a reader, the way around this problem
    is to *run* or *execute* the /some/file instead of sourcing it.
    You can accomplish that with either:
    ./some/file (if it has executable flag set)
    or
    sh /some/file (if it does not have executable flag set)


    -RW


  6. Re: System hangs after running rc.S

    Robby Workman wrote:
    >
    > I believe you're thinking sourcing a file from another; IOW, you
    > could do this:


    Yep, this is what I was thinking of - I think you were the guy who had
    found the problem....

    - Kurt

  7. Re: System hangs after running rc.S

    +Alan Hicks+ wrote:
    >
    > The proper way when doing something along those lines, is not to source
    > the script but simply to call it directly.
    >
    > . /etc/rc.d/rc.foo # bad if rc.foo contains an explicit termination
    > /etc/rc.d/rc.foo # good if rc.foo contains an explicit termination
    >
    > Savy?


    Yep, makes sense - thanks,

    - Kurt

+ Reply to Thread