Topic
6 replies Latest Post - ‏2010-01-22T12:58:24Z by premlink
premlink
premlink
8 Posts
ACCEPTED ANSWER

Pinned topic How to run cli before bash prompt

‏2010-01-20T13:01:32Z |
Hi,

I am working on server platform and i wanted to run my cli before the linux bash prompt comes up.It is an ext3 filesystem that i am using.I did some modifications in /etc/inittab to start the cli before the bash prompt starts,but could not succeed.

Morover is there a way to enable and disable the linux bash prompt.

Help me with any information.

Thanks,
prem
Updated on 2010-01-22T12:58:24Z at 2010-01-22T12:58:24Z by premlink
  • ishields
    ishields
    988 Posts
    ACCEPTED ANSWER

    Re: How to run cli before bash prompt

    ‏2010-01-20T14:48:55Z  in response to premlink
    By cli, do you mean a command line interpreter in the sense of an alternate shell? You can change your default shell using the chsh command. See the man page for details. If this isn't what you are trying to do, post again with more description of what you are trying to accomplish.

    Ian Shields
    • premlink
      premlink
      8 Posts
      ACCEPTED ANSWER

      Re: How to run cli before bash prompt

      ‏2010-01-20T18:24:36Z  in response to ishields
      Hi Ian,

      Thank you for the reply.

      Iam working on server platform which has some diagnostic(cli command line interface) to be run before the linux bash prompt comes up.This is written as script which will do user specfic command parsing and command execution. It is not a shell.I have to run this script file at such a place in filesystem that it gets executed before the linux bash prompt starts.

      Ex:
      ---

      cli> set_ip_addr 192.x.x.x

      • This will set an ip address 192.x.x.x

      I have tried placing this in /etc/inittab ,but it is not getting executed and bash prompt is up with executing this script.

      Also is there any command to revert back to bash prompt from this cli. ?
      Thanks
      Prem
      • ishields
        ishields
        988 Posts
        ACCEPTED ANSWER

        Re: How to run cli before bash prompt

        ‏2010-01-20T18:43:27Z  in response to premlink
        I'm really not at all clear on what you're trying to achieve. There is no bash prompt until a user logs in. Are you trying to do this on a system-wide basis before there's even a login prompt? Or are you trying to do something between the time a user logs in and the time that user sees a bash prompt on a TTY terminal (or a graphical desktop)? Setting an IP address looks like something for the former, in which case you probably need to understand either upstart (newer systems) or inittab (older systems) processing.

        Ian Shields
        • premlink
          premlink
          8 Posts
          ACCEPTED ANSWER

          Re: How to run cli before bash prompt

          ‏2010-01-21T05:39:33Z  in response to ishields
          Hi Ian,

          Yes, Iam trying to do this even before a login prompt comes up.I wanted to run this script in the inittab part of the filesystem and iam looking for the correct way (i.e any format)to run this script in the /etc/inittab.

          Thanks,
          prem
  • premlink
    premlink
    8 Posts
    ACCEPTED ANSWER

    Re: How to run cli before bash prompt

    ‏2010-01-22T12:58:24Z  in response to premlink
    Hi,

    In the /etc/inittab, i have used
    init level 3 as default and in /etc/rc3.d/S99local i place my script file for execution.

    This will execute the script just before the login prompt comes up.

    Thanks,
    prem