Mac OS X 10.4 Tiger What's New for UNIX Users? General Highlights - - PowerPoint PPT Presentation

mac os x 10 4 tiger
SMART_READER_LITE
LIVE PREVIEW

Mac OS X 10.4 Tiger What's New for UNIX Users? General Highlights - - PowerPoint PPT Presentation

Mac OS X 10.4 Tiger What's New for UNIX Users? General Highlights Pervasive Searching Automator VoiceOver Parental Controls SyncServices New and Upgraded Apps Dashboard iChat AV conferencing Safari RSS QuickTime 7 with H.264


slide-1
SLIDE 1

Mac OS X 10.4 “Tiger”

What's New for UNIX Users?

slide-2
SLIDE 2

General Highlights

Pervasive Searching Automator VoiceOver Parental Controls SyncServices

slide-3
SLIDE 3

New and Upgraded Apps

Dashboard iChat AV conferencing Safari RSS QuickTime 7 with H.264 Mail.app now uses SQLite

slide-4
SLIDE 4

UNIX Highlights

Filesystem fun (indexing and attributes) 64 bit libSystem Performance Performance Performance! Developer Tools update ASL “Apple System Logger” launchd “

  • ne daemon to rule them all”
slide-5
SLIDE 5

Kernel

fine grain locking SMP KPI work FS locking is no longer per filesystem Improved Unix Conformance 64 bit userland support Performance

slide-6
SLIDE 6

File Systems

Extended attributes (POSIXy superset) EAs are emulated on non supporting FS types ACLs (favoring NT behavior) Higher level Spotlight search APIs UDF closer to 2.5 HFS improved built-in de-fragmentation

slide-7
SLIDE 7

File System commands

cp, mv and friends are EA aware rsync requires the -E flag cvs is not EA aware

slide-8
SLIDE 8

Networking

Wide Area Bonjour using DNS updates Ethernet channel bonding/failover IPSec support for certificates Firewall logging, ipfw2 and IPv6 firewalling site to site VPN and support for Kerberos dummynet

slide-9
SLIDE 9

Drivers

Improved Power Management APIs 64 bit shimming for ABI reasons Adding a 802.11 family Support for persistent disk device nodes GPT support

slide-10
SLIDE 10

Userland

Perl 5.8.6 Python 2.3.5 Ruby 1.8.2 Tcl 8.4 Wait for the Q&A and I can check other tools.

slide-11
SLIDE 11

Apple System Logger “ASL ”

A system database of log messages Easy searching Advanced pruning More flexable logging API Powerful “mixer” like filter control

slide-12
SLIDE 12

Service Management in Mac OS X

slide-13
SLIDE 13

Daemons A long running background processes Super-daemons A daemon that proxies some execution for other daemons Agents Daemons that operate during and only for a given login session Communication handle A Unix socket or Mach port

Terminology

slide-14
SLIDE 14

Assumptions

Prior experience writing a daemon in the Mach or Unix world Familiarity with Mach IPC or Unix system calls

slide-15
SLIDE 15

Introducing launchd

launchd is all about background processes Work directly on behalf of a user Work indirectly on behalf of a user or users You need to get your code running at some point in the system

slide-16
SLIDE 16

What’s Wrong With the Status Quo?

Daemons deserve better treatment In both Unix and Mac OS, daemons were just processes which disassociated them from user input “Faceless background applications” in Mac OS 9 parlance

slide-17
SLIDE 17

The Solution:

A new super-daemon to manage them Designed to do work for you Designed to be flexible Designed to support messaging and control

slide-18
SLIDE 18

Launchd Is Open Source

A critical Darwin component We want all Unix daemons to adopt this technology Open Sourcing it encourages adoption

slide-19
SLIDE 19

The issues that a modern daemon writer faces What launchd does What launchd doesn’t do How to port an existing daemon to launchd How to write a savvy launchd daemon

What will be covered

slide-20
SLIDE 20

Unix History

inetd Launches IP based daemons on demand at run-time Assumes only one FD handle per daemon init Maintains login daemons on ttys at run-time / etc/rc* A shell script that runs to configure a Unix system. It often runs other scripts which in turn launch daemons Poor support for run-time control cron/at/batch: Time centric

slide-21
SLIDE 21

Mach History

mach_init Launches daemons on demand based on Mach port IPC

slide-22
SLIDE 22

Today’s Problems

Missing functionality: Unix local domain socket support File system based events to trigger a daemon launch init and inetd don’t support user supplied jobs Multiple event sources: Networking daemons commonly listen on multiple ports these days Some daemons use both Mach and Unix based IPC Ultimately, time, file system, and IPC events need to be supported in the same “ super-daemon” The ability to restart a daemon is important

slide-23
SLIDE 23

The Future

One daemon to rule them all Support for transferable based event sources Most file descriptors Mach ports Support for user supplied jobs

slide-24
SLIDE 24

So What Does this Mean?

Hopefully less work for you No need to daemonize fork() and have the parent exit() setsid() closing stray file descriptors reopening stdio as /dev/null etc.

slide-25
SLIDE 25

Launch on Demand

Helping you help us save system resources We support keeping your communication handles alive even when you’re not running This saves system resources It also improves the system boot-up speed

slide-26
SLIDE 26

Parallel Load at Boot

Making boot-up even more dynamic We register all daemons configuration handles first Then we let daemons run This lets us remove the need for externally specified dependancies

slide-27
SLIDE 27

User-Agents

Users have their own special needs too! Standardizes the way we launch user-agents Allows us to launch them on demand too, thus improving login performance

slide-28
SLIDE 28

Case Studies

The real world is what matters cupsd Uses mach APIs to enable automatic restarting with launchd, no extra code is needed mDNSResponder uses both Mach ports and Unix file descriptors launchd handles both, nothing else does for launch-on-demand

slide-29
SLIDE 29

More Case Studies

User examples ssh-agent Complicated to automate the management of Most users only want one per session launchd makes this trivial with small modifications to ssh-agent

slide-30
SLIDE 30

What Doesn’t Launchd Do?

Monitor non kernel fundamental event sources: configd’s database key/values configd’s events NetInfo’s database key/values Bonjour service advertisements IO Kit’s namespace (which is built upon mach ports) IO Kit events (e.g. power management) etc.

slide-31
SLIDE 31

Wait! Not XYZ?!?

This is subject to change We have our own internal needs too

slide-32
SLIDE 32

Porting

The high level overview A simple IPC API A simple RTTI based object system to support message passing

slide-33
SLIDE 33

The IPC API

Kinda-sorta-CoreFoundation So why not CF? Portability Mach port and file descriptor passing is not supported by CoreFoundation at the moment All we need is RTTI, dictionaries and arrays

slide-34
SLIDE 34

C APIs

#include <launch.h> launch_data_t launch_msg(launch_data_t); int launch_get_fd(void);

slide-35
SLIDE 35

C API Semantics

launch_data_t represents an object graph launch_msg() is a synchronous API for the common case Returns NULL and sets errno on failure If you request asynchronous messages be sent back: Call launch_msg(NULL) to get an asynchronous message Keep calling until you get NULL back If errno == 0, then no more asyncrhonous messages are available for reading

slide-36
SLIDE 36

launch_data_t

RTTI and container classes are fun! Dictionaries Arrays File Descriptors Mach Ports Integers Real numbers Booleans Strings Opaque Data

slide-37
SLIDE 37

launch_data_t APIs

“ Just enough for IPC, and no more” Get/set operations for basic types Dictionaries: insert lookup remove interate Arrays: set index get index get count

slide-38
SLIDE 38

XML plist keys

Label UserName GroupName ProgramName Root Umask WorkingDirectory ServiceDescription ProgramArguments EnvironmentVariables EventSources

slide-39
SLIDE 39

What Are EventSources?

Details, details, details… How to setup a given mach port or socket Who to connect to… Where to listen… etc.

slide-40
SLIDE 40

XML plist → launch_data_t

Data distillation UserNames → UIDs GroupNames → GIDs “ stuff” → file descriptors and mach ports

slide-41
SLIDE 41

Example Messages

Dictionaries where the key is the command SubmitJob RemoveJob GetJobs CheckIn SetUserEnvironment UnsetUserEnvironment GetUserEnvironment

slide-42
SLIDE 42

Rehash

launchd is the future Less work for you pre-daemonized when main() is called Just check-in and go Automatic restarting More flexibility in what event sources you react to Multiple Unix file descriptors Multiple Mach ports User agents A powerful concept for per session background processes

slide-43
SLIDE 43

Demo

slide-44
SLIDE 44

Apple’s Open Source Web Site http:/ /developer.apple.com/darwin/

For More Information

slide-45
SLIDE 45

Q&A