Women in Technology

Hear us Roar



Article:
  Start Me Up: Writing and Understanding OS X StartupItems
Subject:   Stop
Date:   2003-10-23 08:38:37
From:   anonymous2
Response to: Stop

Why would you have to specifically shutdown one item?
I'm no expert but I think that a shutdown in unix kills all running processes. That would include the Tomcat server, Apache, MySql etc.
It would be kind of redundant to write a specific shutdown item when shutting down the system.
Full Threads Newest First

Showing messages 1 through 3 of 3.

  • Stop
    2003-10-23 08:52:00  Andrew Anderson | [View]

    Killing a process is not the best way to stop a process because it does not take into account the processes state.

    For instance:
    I have mysql running and I am in the midst of an insert, OS X (or the user) kills the process, does the data get inserted correctly ? What part of the insert did it stop in the middle of ? Did half of the insert work ?

    Same can happen in Apache or Tomcat. Think a php script or Java class that writes an external file or goes to a database.

    Shutdown procedures allow the program to clean up after itself before stopping, wait for a database connection to cease or else cease it, explicitly close or wait for files to close, etc.
  • Stop
    2003-10-23 12:35:53  anonymous2 [View]

    Killing a process isn't enough for many types of servers - it can result in data loss, or worse. Without support for shutdown items, OS X is still not suitable for use as a server OS. This is the most glaring omission in an otherwise fine OS, and is a show-stopper for serious use.
    • Stop
      2003-10-23 13:55:29  Andrew Anderson | [View]

      Saying that "OS X is still not suitable for use as a server OS" is a bit of an overstatement.

      If you write a script that does:

      1.) stop all services that were started as StartupServices, ie/ run 'SystemStarter stop'

      2.) stop all services that were started outside of StartupServices (like something that was put manually into rc )

      3.) if you are allowing remote ssh logins, warn users that the machine is shutting down with "write"

      Run the script as root and then do the shutdown. Or write an AppleScript that does the shutdown for you and add that to the script.