rc scriping: why init.d?

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: rc scriping: why init.d?

    Rich Gray <richNOgSPAM@plustechnologies.com> writes:
    > Q: Is there a way for an application to get notification when
    > shutdown is first invoked? By default, humans typically get
    > a minute of grace to finish up. It would be nice if our
    > scheduler knew that a shutdown was coming in nnn seconds. It
    > could supspend dispatching new jobs and condition running jobs
    > to either finish up or get to a reasonable stopping point in
    > the alloted grace interval.
    In most installations, all processes are sent the SIGTERM signal prior
    to system shutdown. After this, they are given some time (a few
    seconds) to clean up. Do you want something else?

    --
    Måns Rullgård
    [email]mru@users.sf.net[/email]
    Måns Rullgård Guest

  2. Similar Questions and Discussions

    1. init.pl help needed please
      I have following not working it report that I have Can't find string terminator "STR" anywhere before EOF at init.pl line 50. Compilation failed in...
    2. init.d
      Where can I find a list of what all those scripts in init.d means (what they are used to start/stop) ? -- Stojcevski Dejan e-mail:...
    3. XDM init file
      Hi All, I've just started using xdm rather than loggin strigh in on the console. One thing I have found is that instead of calling ~/.xinitrc and...
    4. Log of init.d services started....
      Is there any log of services started on boot from the rc?.d/init.d directories. For reason I can't fathom (yet), my DSL connection doesn't come...
    5. Debuging inittab init.d rc*.d
      on Solaris 5.x Could someone help me what to do, and where to look for debug information/logs of echo command display from init.d script? My...
  3. #2

    Default Re: rc scriping: why init.d?

    Måns Rullgård wrote:
    >
    > Rich Gray <richNOgSPAM@plustechnologies.com> writes:
    >
    > > Q: Is there a way for an application to get notification when
    > > shutdown is first invoked? By default, humans typically get
    > > a minute of grace to finish up. It would be nice if our
    > > scheduler knew that a shutdown was coming in nnn seconds. It
    > > could supspend dispatching new jobs and condition running jobs
    > > to either finish up or get to a reasonable stopping point in
    > > the alloted grace interval.
    >
    > In most installations, all processes are sent the SIGTERM signal prior
    > to system shutdown. After this, they are given some time (a few
    > seconds) to clean up. Do you want something else?
    >
    > --
    > Måns Rullgård
    > [email]mru@users.sf.net[/email]
    Yes. The killall behavior happens after the apps have had a
    chance to be shutdown cleanly by rc scripts. (I presume that at
    rc shutdown time, apps are expected to terminate in some short
    number of seconds.)

    What I'm looking for is some sort of 'heads up' prior to the
    start of the actual shutdown process. For example, on several
    SV'ish systems, the admin can issue:

    shutdown -y -g120 -i0

    to put out a two minute warning to users, then take the system
    to a halt after that interval elapses. It would be nice if my app
    could also get a two minute warning so as to have a less abrupt
    shutdown. I've never seen a hint of such, but figured why not
    ask?

    --
    Rich
    mailto:richNOgSPAM@plustechnologies.com (remove NO SPAM to reply)
    [url]http://www.plustechnologies.com[/url]
    Rich Gray Guest

  4. #3

    Default Re: rc scriping: why init.d?

    In article <3F042CD3.2B91C4B3@plustechnologies.com>,
    Rich Gray <richNOgSPAM@plustechnologies.com> writes:
    > I'm cleaning up some rc scripts and have a few questions.
    >
    > Q: Why put the start stop script in the init.d directory instead
    So the system admin can easily find it to run it by hand.
    > just linking the rc#.d/S & K scripts straight back to a file
    > in the project's directory tree? (One less system specific
    That can be done too.
    > file to add/remove at install/uninstall.) Similary, for AIX,
    > (the only OS I have to support which does not seem to have
    > a flavor of SysV'ish rc scripting) why not have the inittab
    > entry point directly to a start script in the project's
    > directories instead installing/removing /etc/rc.project.
    It makes packaging easier. A product just drops it's own files
    into the relevant directories and it automatically gets started
    and stopped at the appropriate times. When you uninstall that
    product, it simply has to delete its files. Multiple products
    having to edit themselves into files shared by other things,
    and edit themselves out when they are uninstalled, is always
    more problematic.
    > I think I know the answer department:
    >
    > Q: Is there a way for an application to get notification when
    > shutdown is first invoked? By default, humans typically get
    > a minute of grace to finish up. It would be nice if our
    > scheduler knew that a shutdown was coming in nnn seconds. It
    > could supspend dispatching new jobs and condition running jobs
    > to either finish up or get to a reasonable stopping point in
    > the alloted grace interval.
    Some varients of shutdown create /etc/nologin to prevent further
    logins. You might be able to check for the existance of that
    file.

    On one system I administered, I rewrote shutdown to better suit
    our needs, including things like sending SMB message to all samba
    clients with resources mounted, and issuing the rwall warnings
    all in parallel so loads of non-responding NFS clients didn't
    make it take 10 times longer than you asked for.
    You could produce a customised version for your environment.

    --
    Andrew Gabriel
    Consultant Software Engineer
    Andrew Gabriel Guest

  5. #4

    Default Re: rc scriping: why init.d?

    Andrew Gabriel wrote:
    >
    > In article <3F042CD3.2B91C4B3@plustechnologies.com>,
    > Rich Gray <richNOgSPAM@plustechnologies.com> writes:
    > > I'm cleaning up some rc scripts and have a few questions.
    > >
    > > Q: Why put the start stop script in the init.d directory instead
    >
    > So the system admin can easily find it to run it by hand.
    So this is mostly convention. It also explains why handy things
    above and beyond 'start' & 'stop' functionality (like 'restart')
    are in the init.d scripts. Good enough for me.
    > > just linking the rc#.d/S & K scripts straight back to a file
    > > in the project's directory tree? (One less system specific
    >
    > That can be done too.
    >
    > > file to add/remove at install/uninstall.) Similary, for AIX,
    > > (the only OS I have to support which does not seem to have
    > > a flavor of SysV'ish rc scripting) why not have the inittab
    > > entry point directly to a start script in the project's
    > > directories instead installing/removing /etc/rc.project.
    >
    > It makes packaging easier. A product just drops it's own files
    > into the relevant directories and it automatically gets started
    > and stopped at the appropriate times. When you uninstall that
    > product, it simply has to delete its files. Multiple products
    > having to edit themselves into files shared by other things,
    > and edit themselves out when they are uninstalled, is always
    > more problematic.
    I certainly understand and appreciate the 'drop in to install'
    and 'delete to uninstall' convention. Unfortunately, the old
    versions of AIX I have don't seem to support this. One must
    add/remove entries to inittab. (Where they point comes back to
    my above question: their place or ours?)
    > > I think I know the answer department:
    > >
    > > Q: Is there a way for an application to get notification when
    > > shutdown is first invoked? By default, humans typically get
    > > a minute of grace to finish up. It would be nice if our
    > > scheduler knew that a shutdown was coming in nnn seconds. It
    > > could supspend dispatching new jobs and condition running jobs
    > > to either finish up or get to a reasonable stopping point in
    > > the alloted grace interval.
    >
    > Some varients of shutdown create /etc/nologin to prevent further
    > logins. You might be able to check for the existance of that
    > file.
    Ah, we could have our processes optionally check for that file.
    Thanks for the pointer.
    > On one system I administered, I rewrote shutdown to better suit
    > our needs, including things like sending SMB message to all samba
    > clients with resources mounted, and issuing the rwall warnings
    > all in parallel so loads of non-responding NFS clients didn't
    > make it take 10 times longer than you asked for.
    > You could produce a customised version for your environment.
    Not practical for canned software, but certainly a reasonable thing
    for a site to do.
    >
    > --
    > Andrew Gabriel
    > Consultant Software Engineer
    THANKS for your comments!

    --
    Rich

    mailto:richNOgSPAM@plustechnologies.com (remove NO SPAM to reply)
    [url]http://www.plustechnologies.com[/url]
    Rich Gray Guest

  6. #5

    Default Re: rc scriping: why init.d?

    in comp.unix.programmer i read:
    >In article <3F042CD3.2B91C4B3@plustechnologies.com>,
    > Rich Gray <richNOgSPAM@plustechnologies.com> writes:
    >> I'm cleaning up some rc scripts and have a few questions.
    >>
    >> Q: Why put the start stop script in the init.d directory instead
    >
    >So the system admin can easily find it to run it by hand.
    in addition. /etc should always be available during boot, but the
    directory in which `the project' lives may not.

    --
    a signature
    those who know me have no need of my name Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139