Advertise Bonjour for a daemon using launchd plist

Gents,
How do I use launchd.. plist to make bonjour available for my daemon?
Its hard to find what is possible en what I need to setup in the plist.
This sounds vague for me.
Sockets <dictionary of dictionaries... OR dictionary of array of dictionaries...>
This optional key is used .................... sed as inputs to call getaddrinfo(3).
Bonjour <boolean or string or array of strings>
This optional key can be used to request that the service be registered with the
mDNSResponder(8). If the value is boolean, the service name is inferred from
the SockServiceName. SockServiceName. Name.
I would like, if it is possible to have, advertise Bonjour + Bonjour text available to the client.
Also how will the total bonjour string looks like? Where can I find a description about that?
Any references and idea's?
Thank you.

doug pennington wrote:
I don't know the what of your text you want to advertise, but it, the text has to come off of your machines web server(at least from my experience). man dns-sd shows some info. The path can be tricky. Should be dns-sd -R "My Test" http.tcp . 80 path=/~short name/directory of text(with text enclosed)/ (I used Sites) Now this very possibly could not be what you are asking.
I hope it is possible, because if a client.app is searching for the right service or kind of notification then is has to start the daemon before it get the text.
I also have supply a service type, with that I have to add a TXT record with meta data.
{quote}
The specific nature of the TXT record and how it is to be used is service type dependent. Each service type will define zero or more name/value pairs used to store meta-data about each service.{quote}
http://developer.apple.com/mac/library/qa/qa2001/qa1306.html
and
http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt Page 12 chapter 6...
Also It looks like you now about this stuff I have another question, more developing specific.
Hope to meat you there also http://discussions.apple.com/thread.jspa?threadID=2446760&stqc=true

Similar Messages

  • Request for additional functionality of launchd.plist

    Currently, launchd isn't designed to be event-driven via the launchd.plist. To remove the burden from developers, and to make launchd actually useful (cool!) for system administrators, here's a list of useful event options that could be added to launchd.
    OnGUILogin, to launch jobs when a new GUI session starts, with options to specify Aqua or an X11 session.
    OnGUILogout, like OnGUILogin, to launch jobs when logout is done (optionally to wait until exit before loginwindow is shown), or when the Apple's rootless X11 application is given the Quit command.
    OnGUISession, to launch jobs when a user logs in via the loginwindow as a result of fast user switching.
    OnGUISessionSwtich, to launch jobs when a user switches away from his or her desktop as a result of OnGUISession being triggered, with options for the switched-to GUI session to wait to get to the desktop until the job exits.
    OnConsoleLogin, to launch jobs when login(1) is run via a console.
    OnConsoleExit, to launch jobs to completion before exit(1), well, exits.
    OnShutdown, to replace the functionality (or lack of) that SystemStarter provides by supporting the rc.shutdown.local script.
    OnVolumeMount, with options for specifying GUID, Volume Name, Mount Point, or Media Type (USB, CD, DVD), Device Node, or Bus, so that a process can launch as a result of any, or a specific, volume mounting.
    OnVolumeUnmount, like OnVolumeMount, with option to block umount from finishing so that a job can access the volume before it's gone
    OnVolumeEject, for responding to media ejects
    Properly, OnVolumeMount, OnVolumeDismount, and OnVolumeEject would have its plist published to the specified volume upon being run, and launchd would publish the current version before the media is unmounted.
    This way, a removable device may act as a source or destination repository of launchd jobs, across multiple machines. In a way, this makes the volume "intelligent", and can become self-aware.
    Imagine a flash drive that installs system updates via Installer on machines that need them. Or a CD that checks itself for integrity against a volume MD5 checksum when its inserted.
    Or better yet, a volume that uses Time Machine and asks for an update if its stale. Taking that idea further, imagine a flash drive, formatted as XFS (that Time Machine should use in the future), that takes snapshots of a user's files for instant get-away, gotta go situations where certain files are needed. Kind of like a Back-To-My-Mac via removable media. On top of that, publish a resource on the volume to make it a mobile standalone equivalent of Window's System Restore.
    Integrating this functionality for those three options with securityd's user-agent would allow a user to permit such programs to to run or not (and flag them safe as when Internet downloaded files are launched for the first time, or as when Application sandboxing signs the executable).
    I hope this interests the Apple developers that make launchd. It seems all too often Apple's administration tools could be taken so much further to make our Macs true delight.
    Hope you enjoyed reading.

    I see now that the "StartOnMount" option in the plist can respond to a volume mounting.
    After further reading the man page, trying to decipher the -S and -D options to launchtl, this is what I understand, some or all of which may be wrong:
    1. The Aqua session is created when a user initially logs in. Jobs can be sarted as a result via the RunAtLoad option.
    2. The LoginWindow session is created when a user returns to the login window. I wonder is this is triggered by Logout, Fast User Switching, and/or the Screen Saver methods.
    3. The Background, StandardIO, and System session types aren't defined beyond having their names mentioned in the manual.
    4. The -S option, in combination with the -D option, requires plists exist in the LaunchAgents folder, not the LaunchDaemons folder of the domain.
    5. The session option enables the "user" domain, which based upon the manual example probably means jobs defined in ~/Library/LaunchAgents/.
    As a response to (3) above, how does one create or manage the sessions?

  • Using Bonjour for video chat to windows computer

    I'm wondering if it is possible to use Bonjour to do video chats accross the network from a mac to windows xp pc. Thanks in advance for any help or answers.

    Sure can. You would need to have Bonjour installed on the Windows PC, along with a chat client.
    Here's Bonjour for Windows: http://www.apple.com/support/downloads/bonjourforwindows103.html
    Don't forget to adjust the windows firewall settings: http://docs.info.apple.com/article.html?artnum=301514
    And here is a 3rd party chat client for windows: http://xurble.org/projects/iChatMiranda or you can use Trillian http://www.ceruleanstudios.com/
    I hope this helps!
    OOOPs. I just saw that you were asking for video chats, unfortunatly, there is no client that I'm aware of that supports Bonjour Video on the PC...sorry!

  • Printer shared from my Mac is not seen from a PC using Bonjour for Windows

    I am going nuts here, hope someone can help.
    I have a Canon multi-function printer (MP830) attached via USB to a Mac G4 (with Mac OS X Tiger). At one time, I had it set so a Windows 2000 PC could print to it but deinstalled it after some printing issues, and have been unable to get to working again. The machines are connected together via a Netgear router. As far as I know, everything is the same as it was before, yet I cannot get it to work as it did.
    - The printer works fine from the Mac.
    - If I connect the printer to the PC, it works fine.
    - On the PC, using Bonjour for Windows, I cannot see the printer attached to the Mac but I can see, and print to, an Epson printer that is attached to a different Mac.
    - And from the second Mac, I am able to see -- but not successfully print to -- the Canon printer. The print job stays in the queue of the second Mac and says "Unable to connect to SAMBA host, will retry... Error: Connection failed with error."
    - I have tried:
    -- de-installing and re-installing Bonjour for Windows and the Canon print drivers on the PC
    -- and have de-installed and re-installed the Canon drivers on the Mac
    -- I have removed and re-added the Canon printer on the Mac. Printer Sharing is on, and this printer is checked in the Sharing box.
    Any suggestions?
    G4 Quicksilver and Dell PC with Windows 2000   Mac OS X (10.4.9)   Canon MP830

    Thank you. Those are beautifully written procedures.
    Looks like it's a network issue. I reach the step, "Adding a printer using the wizard":
    You must enter the following URL, you must use the Queue Name you noted down earlier
    http://<IP address of Mac>:631/printers/Queue Name
    which I do, entering
    http://192.168.0.4:631/printers/MP830
    and I get the following error:
    "Could not connect to the printer. You either entered a printer name that was incorrect or the specified printer is no longer connected to the server."
    And then I am toast!
    Using the other procedure, I simply don't see the Mac's printers in the Bonjour Wizard's "Browse for Bonjour Printers" window.
    Not sure where to go from here -- any ideas?
    The Mac's IP (set via DHCP) is 192.168.0.4, subnet mask 255.255.255.0. The PC is 192.168.0.5, I can't find the subnet mask.
    Pretty sure it's a network config issue, especially isnce I can Bonjour to my other Mac.
    TIA...

  • Launchd.plist quandry

    Per an earlier post, I finally got Snort® NIDS v2.8.3 compiled, installed, and configured on my Mac Pro running OS 10.5.4. It runs fine if invoked from the keyboard, in either daemon mode or non-daemon mode. I am having problems with launching it via launchd.plist, though, and am hoping that someone can look at my plist with a fresh set of eyes and perhaps be able to immediately tell me why snort isn't launching at computer bootup.
    I want to launch an occurrence of Snort in daemon mode via launchd at bootup. The command that I use to invoke Snort in daemon mode from Terminal's command line is:
      /usr/local/bin/snort -DdevI -i en2 -l /var/log/snort/ -c /usr/local/snort-2.8.3/etc/snort.conf
    This command works fine from Terminal's command line, and launches snort in daemon mode, when root.
    My /Library/LaunchDaemons/snort.plist is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>snort</string>
    <key>ServiceDescription</key>
    <string>launch SNORT® network intrusion detection system at bootup</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/bin/snort</string>
    <string>-DdevI</string>
    <string>-i en2</string>
    <string>-l /var/log/snort/</string>
    <string>-c /usr/local/snort-2.8.3/etc/snort.conf</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist> 
    Other info of interest:
    -rwxr-xr-x 1 root wheel /usr/local/bin/snort
    -rw-r--r-- 1 root wheel /usr/local/snort-2.8.3/snort.plist
    lrwxr-xr-x 1 root wheel /Library/LaunchDaemons/snort.plist -> /usr/local/snort-2.8.3/snort.plist 
    (Note: It is common practice of mine to keep my homebrew launchd plists with the scripts or binaries themselves, and put sym links in /Library/LaunchDaemons/ or ~/Library/LaunchAgents/)
    Thanx, anybody, in advance for any help that you can provide.

    1. You should get rid of the "®" in your plist for reasons both legal and syntactic--the Snort logo is a registered trademark on the PTO's principal register, the word "snort" is not.
    It would seem that the ServiceDescription functionality, recognized in Tiger, is no longer recognized as a valid launchd.plist keyword in Leopard. The console log indicates that this is now an unrecognized key word -- in each and every one of my launchd items. That keyword, along with its string, was removed. It didn't help, however.
    2. You should not be symlinking anything.
    Symlinking launchd plists has never, ever caused me problems before, and I have probably a half dozen symlinked plists. But, in the interest of trying to get this to work properly, I rm'ed the symlink, and mv'ed the actual plist to /Library/LaunchDaemons. Didn't cure the problem, though.
    3. You should be using *launchctl load* for immediate feedback.
    Thanks for that. I can never remember that command name!
    4. You should read these cover-to-cover:
    http://developer.apple.com/macosx/launchd.html
    http://developer.apple.com/technotes/tn2005/tn2083.html
    OK - done - nothing there jumped out at me as problems with what I was doing, but, handy references to have lying around. I'm already practicing the convention discussed therein that non-user-specific, homebrew, faceless jobs should go in the /Library/LaunchDaemons folder, as would make sense for a NIDS. So I'm not sure if you had something specific in mind when citing these articles or not....

  • Launchd plist xml to run job several times a day?

    I've been reading about using launchd instead of cron.
    For the life of me I can't find out how to run a script at 10AM and 2PM
    Can you use:
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>10</integer>
    <key>Hour</key>
    <integer>14</integer>
    or maybe
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>10</integer>
    <integer>14</integer>
    Maybe I need 2 plists?
    If I wanted to run it every X minutes, I can program that into the XML but I don't know how you could do several specified times a day... or for that matter just on Monday and Friday?
    I've Googled all night and can't find an example. What is the trick... if there IS a trick?
    Thanks,
    Al

    In Apple's system-lingo: "A daemon is a program that runs in the background as part of the overall system (that is, it is not tied to a particular user). A daemon cannot display any GUI; more specifically, it is not allowed to connect to the window server." (see Tech Note 2083)  It doesn't have to be a continuously running program, just one that doesn't interact with users directly.  Your script will probably work in either location, mind you, so the distinction might be academic.
    All enabled plists are loaded at restart or login.  Enabled plists are plists in one of the three user-accessible launchd folders (already mentioned) which are not explicitly disabled by a Disabled key set to true (it's actually a little more complicated than that - the Disabled key in the plist is 'advisory', and the system stores the real enabled list in an undisclosed location - but it usually works).  You only need to use launchctl if you are manually updating a plist and don't want to log out, or sometimes in super-tricky cases where you want to programmatically load a plist (in those cases you set the plist's Disabled key to true so it doesn't load, and then script launchctl to load it by override the Disabled key with the -F or -w options.  probably TMI).  it is set-it-and-forget-it.
    There's no simple utility for this, I think, because not that many people use launchd directly, and those few who do tend to write plists, toss them in the correct folder, and forget about them.  I have a applescript I use for loading and reloading plists which I keep in the script menu:
    on run
              tell application "Finder" to set theItems to the selection as alias list
      relaunchd(theItems)
    end run
    to relaunchd(theItems)
              repeat with thisPlistFile in theItems
                        tell application "Finder" to set containerName to displayed name of container of thisPlistFile
                        if containerName is in {"LaunchAgents", "LaunchDaemons"} then
                                  set thePath to quoted form of (POSIX path of thisPlistFile)
                                  do shell script "launchctl unload " & thePath
                                  do shell script "launchctl load " & thePath
                        end if
              end repeat
    end relaunchd
    The difference between launchd and cron is that cron is (pardon me for putting it this way) a unix-geek tool: its language is highly compressed and symbolic.  good for fast typing in a command-line environment, bad because a single mistyped character can become a major headache to diagnose and fix.  Launchd (like many things Apple) is much more verbose and 'natural language'-like, which means a lot more typing but a generally more user-friendly experience (once you wrap your head around it).  tradeoffs vs. tradeoffs.

  • Truly required keys in launchd plist file

    I am trying to get a launchd plist to work and run all the time. I want it to shut down my Mail.app on a certain day of the week (when I am not there). Of course, I want another one to turn it on when I get in the next day. The only plist keys that are supposed to be required are the Label and ProgramArguments. However, unless I also add the StartInterval key (any setting), my script is never called in the first place. (I have not tried any other keys yet, I am still testing this thing out.)
    Without the StartInterval, the launchctl list still shows the correct plist file is running, but Mail never shuts down. I get this on the command line:
    Workaround Bonjour: Unknown error: 0
    I tried looking into the launchctl log, and it is empty as well.
    Is this a bug, or is it necessary after all to have either StartInterval or StartCalendarInterval keyed in any launchd plist for it to function?
    I appreciate any and all feedback.

    No replies - Have mostly solved through trial and error.

  • Script inside launchd plist

    Hi,
    playing with lauchd plists to get some feeling about how certain things works I came up with this script inside the plist
    <key>ProgramArguments</key>
    <array>
    <string>/bin/sh</string>
    <string>-c</string>
    <string>/bin/df -k| /usr/bin/grep /dev/ | /usr/bin/awk '{ OFS="     "; "date +%d-%b-%Y-%I:%M| getline; print $6, $1, $4, $5;}'</string>
    </array>
    Its close to what I try to do in my trial stage one (1), but see some unwanted and unexpected issues
    1. why is there a tab at the first line?
    2. Where is the first Item, is it replaced with the date or just ignored?
    3. Should I see the result(s) of date as a multi word? If I keep a space between +%d-%b-%Y and %I:%M i get a wrong result.
    *this is what I get*
    29-May-2010-10:53
    /Volumes/TimeMachine /dev/disk5s3 303667180 69%
    /Volumes/RAID01 /dev/disk4 55598552 93%
    /Volumes/Repository /dev/disk0s3 96066032 2%
    /Volumes/Data /dev/disk0s4 506853520 40%
    /Volumes/Applications /dev/disk1s4 11657776 73%
    *This what I actually did expect with the current script ( not what I want );*
    29-May-2010-10:53 / /dev/disk1s3 16190024 62%
    29-May-2010-10:53 /Volumes/TimeMachine /dev/disk5s3 303667180 69%
    29-May-2010-10:53 /Volumes/RAID01 /dev/disk4 55598552 93%
    29-May-2010-10:53 /Volumes/Repository /dev/disk0s3 96066032 2%
    29-May-2010-10:53 /Volumes/Data /dev/disk0s4 506853520 40%
    29-May-2010-10:53 /Volumes/Applications /dev/disk1s4 11657776 73%
    I thought that the date line will get printed every time for each line from the previous piped command
    *This is what I want ( stage 1 )*
    29-May-2010 10:53
    / /dev/disk1s3 16190024 62%
    /Volumes/TimeMachine /dev/disk5s3 303667180 69%
    /Volumes/RAID01 /dev/disk4 55598552 93%
    /Volumes/Repository /dev/disk0s3 96066032 2%
    /Volumes/Data /dev/disk0s4 506853520 40%
    /Volumes/Applications /dev/disk 1s4 11657776 73%
    *This is what I finally want ( stage 2 )*
    29-May-2010 10:53
    / 1s3 16190024 62%
    TimeMachine 5s3 303667180 69%
    RAID01 4 55598552 93%
    Repository 0s3 96066032 2%
    Data 0s4 506853520 40%
    Applications 1s4 11657776 73%
    Any help or ideas are welcome.
    Thanks
    PS.
    Here the total launchd plist script for copy>test ( check output path )
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Debug</key>
    <true/>
    <key>InitGroups</key>
    <false/>
    <key>Label</key>
    <string>net.test.PlayWithMeScript2</string>
    <key>LowPriorityIO</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
    <string>/bin/sh</string>
    <string>-c</string>
    <string>/bin/df -k| /usr/bin/grep /dev/ | /usr/bin/awk '{ OFS="     "; "date+%d-%b-%Y-%I:%M"| getline; print $6, $1, $4, $5;}'</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceDescription</key>
    <string>Play With me script</string>
    <key>StandardOutPath</key>
    <string>/Volumes/TestBedDevelopment/TestLogs/log3.txt</string>
    <key>StartInterval</key>
    <integer>60</integer>
    <key>WorkingDirectory</key>
    <string>/</string>
    </dict>
    </plist>

    Absolutely true, but to learn the effects of the shell created by the launchd and a comment somewhere on the web about "if it can in launchd do it there" and that I dont want to install to much, I choose for this, for now.
    Then, with all due respect to whoever wrote that article, he's an idiot
    Launchd has many uses, but it's not the right place to put a multi-step script with umpteen pipes and dependencies.
    Besides, I'm actually surprised it even remotely works, since launchd normally requires each element in the command to be in a separate <ProgramArguments> array element. In other words, your original:
    <key>ProgramArguments</key>
    <array>
    <string>/bin/sh</string>
    <string>-c</string>
    <string>/bin/df -k| /usr/bin/grep /dev/ | /usr/bin/awk '{ OFS="\t"; "date+%d-%b-%Y-%I:%M"| getline; print $6, $1, $4, $5;}'</string>
    </array>
    should really be more like:
    <key>ProgramArguments</key>
    <array>
    <string>/bin/sh</string>
    <string>-c</string>
    <string>/bin/df</string>
    <string>-k</string>
    <string>|</string>
    <string>/usr/bin/grep</string>
    <string>/dev/</string>
    <string>|</string>
    <string>/usr/bin/awk</string>
    <string>'{</string>
    <string>OFS="\t";</string>
    <string>"date+%d-%b-%Y-%I:%M"</string>
    <string>|</string>
    <string>getline;</string>
    <string>print</string>
    <string>$6,</string>
    <string>$1,</string>
    <string>$4,</string>
    <string>$5;}'</string>
    </array>
    and now you can see why it's a really, really bad idea to do. Far easier to just:
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/bin/myscript.sh</string>
    </array>
    and put all the logic in a separate file.
    The first line is gone because you're using getline within your awk statement, which tells awk to skip to the next line.
    I did hoped that didn't effect everything after the ;
    No. As per man awk:
    The ``function'' getline sets $0 to the next input record from the current input file;
    so getline moves onto the next line.
    How can I return a value from a launchd?
    What do you mean 'return a value from launchd'? You don't normally interact with launchd, so getting a return value from it doesn't make much sense.
    And why does my script keep running?
    because that's what launchd is for. By default, launchd is tasked with launching a process and keeping it running. So if a process fails it automatically gets restarted. This is normally what you want for system-level processes.
    Now, that said, launchd has a number of variations that you can use to tell it to launch processes at specific times, or when certain events happen, or only at boot time, etc., but you need to add them to your .plist so that launchd knows when (and when not) to launch/restart your process.

  • Using launchd to send an email on startup and shutdown

    Hello All !
    I'd like to get an email whenever my Mac starts up and shuts down, since I have to leave it unattended for quite some long periods of time (and even with the help of a UPS, power goes out anyway...). My Mac runs under Mac OS X Lion.
    I found some help on the Internet, mainly from this page : http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/ , which applies to Linux, and hoped it could work on Mac OS X (I thought at first I could just drop a script in something like /etc/init.d/ or /etc/rc.d/rc5.d but well... we have launchd instead...).
    The first method listed in the page above worked well, but sends an email only on startup (for a reminder: you add a line that starts with @reboot in your crontab, and a command that sends directly an email).
    I then tried to adapt the second method to Mac OS X, and succeeded partially: I wrote a small script based on what was shown on that page (a start and stop function, start gets called when the script is started, and stop gets called based on a trap on various kill signals, with an infinite wait loop: see below). I also wrote the plist file, loaded it in launchd and rebooted my Mac several times to test everything.
    I get an email on each startup (yeah!), but the shutdown mail gets sent only at the next startup. So I guess that postfix gets killed by the shutdown process *before* being able to send my shutdown email :-(
    So here are my main questions, if someone can help me:
    1. is there a way to precisely call a script during the shutdown process, meaning giving it a priority so it gets called before postfix dies ? (like the rc directories and the naming conventions (KnnScriptName and SnnScriptName) found on some Linux/Unix).
    2. is it possible to do that with launchd ? if not, what would be the Mac OS X sanctionned way of doing this ?
    Other things:
    3. my shell script writing ability is kind of rusty, so maybe I made some "very bad shell writingTM": l'm not sure putting an infinite while loop with a 15 second pause in it is the best way of telling a script to do nothing. There might other things in there that would make an Unix guru jump out of his chair: please tell me :-)
    This is my plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
    <plist version=“1.0”>
    <dict>
    <key>Disabled</key>
    <false/>
    <key>Label</key><string>org.amarante.startshutemail</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Library/Scripts/startshutemail-launchd.sh</string>
    <string>start</string>
    </array>
    <key>RunAtLoad</key><true/>
    </dict>
    </plist>
    And this is the script that does the job:
    #!/bin/bash
    # PHL 20120604 startshutemail-launchd.sh
    # Send an email on startup and shutdown (version for launchd)
    # Based on script and explanations found here:
    # http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/
    # Modification history
    # PHL 20120604 v01 First version
    # Environment variables #################################################
    DEST_EMAIL="[email protected]"
    SRV_NAME=Amarante
    EVENT_TIME=$(date +%Y/%m/%d-%H:%M:%S)
    RESTART_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Startup"
    RESTART_BODY="This is an automated message to notify you that $SRV_NAME started successfully at $EVENT_TIME."
    SHUTDOWN_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Shutdown"
    SHUTDOWN_BODY="This is an automated message to notify you that $SRV_NAME is shutting down now ($EVENT_TIME)."
    # Functions ##########
    stop()
    echo "$SHUTDOWN_BODY" | mail -s "$SHUTDOWN_SUBJECT" $DEST_EMAIL
    return 0
    start()
    echo "$RESTART_BODY" | mail -s "$RESTART_SUBJECT" $DEST_EMAIL
    return 0
    # Main part #########
    case $1 in
    stop)
    stop
    start)
    start
    esac
    # trap kill signals to send an email
    trap stop HUP INT QUIT ABRT KILL ALRM TERM TSTP
    # sleep until killed
    while :
      do
        sleep 15
      done
    Thanks for your help, and any comment :-)
    Paul-Henri

    Thanks a lot for your answer, Camelot, even if it sorts of confirm what I suspected. Pinging a machine from an external observer is a solution, but it will also report broken links problems and not only a computer shutting down, and it raises the next tier of problems, general network reliability after individual system reliability. It's something I'll have to look at for sure.
    It's weird there isn't any way to access the way the shutdown process works.
    One of the commenters (#14) on the page from Syntaxtechnology had a similar problem: he added a "sendmail -q" in his script to force sendmail to go to work and service the queue before shutting down, which I can try, but he also added a delay to the stop process of sendmail, which is something I'm not sure I can do on Mac OS X (and that might disappear one day with one of the OS updates).
    Unless there is a way to change the launchd.plist file for postfix and add an ExitTimeOut option in it (I found this idea here : https://discussions.apple.com/message/17229690#17229690 )
    Cheers,
    Paul-Henri

  • Not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    okay well they got me to take out some .plist files to see if that would help it didn't. I'm not sure what ones that they deleted for my self maybe someone here would be abel to tell you what ones to take out but didn't work the one that came close to working was this going into keychain and deleting the account(s) then reading them again.
    if you are to do this please back up first with Time Machine. You can do this with a usb drive.
    Okay so go back to where you had internet accounts and make sure mail is shut. click the - on the account your having problems with then quit system preferences.
    Okay so then press cmd and space bar at the same time then type 'keychain access' into the search then click on 'keychain access'
    once it is open go to the top of the window and put your email address that you are having problems with.
    once you have put in your full email, have a look at what comes up i deleted things in the kind colome with 'internet password' and anything with under name that had smtp.gmail.com or imap.gmail.com so it would look like this, map.gmail.com - internet password.
    right click and delete them. make sure not to touch any other files that dont say them things on them.
    Once you have done this quit keychain access and then restart the computer, once the computer is restarted go back to system preferences and internet accounts and re-add the account.
    Hope this helps. if something is not clear just ask.

  • Bonjour for windows gives this error - You do not have sufficient access...

    I installed Bonjour for windows on a PC running XP. When I run the Bonjour app from windows I can see the printer I wish to connect to. It is shared off of my G3 server. When I try to connect I get the following error,
    "You do not have sufficient access to your computer to connect to the selected printer"
    I have done some research through Apple's info database and found,
    http://docs.info.apple.com/article.html?artnum=302408
    I followed the instructions and still I get the same error. I have rebooted the PC deleted all the printers under the printer window. But no luck. I found a similar request by another apple forum user. His issue was the same but he was using 'Parallels' emulator. But no solution was provided.
    Any suggestions?

    Well this is what I've done to date to try to resolve this issue.
    I uninstalled Bonjour for Windows from my PC. I checked Apples support pages dealing with Bonjour for Windows (BfW). As suggested I deleted all printers in my printer window, (to delete all possible print Queues). I updated my Windows to the latest patch for XP. I reinstalled BfW, with the XP Firewall turned on. It is suggested that BfW will make the necessary changes to the XP firewall to allow traffic going through port 5353. I have tried more than one printer off of my G3 and I double checked my external router port restrictions, and I turned off the firewall on my G3, shared mt printers in OS X, and even turned on windows file sharing. I even updated my G3 to 10.4.8
    I pinged my G3 from my XP machine it's there. Also I can see the G3 with it's printers when I browse the network from the XP box. Also I'm on the same local subnet 192.168.2.x
    The only thing I have not done yet is see if it is possible to ping a bonjour host (my G3) from a bonjour client (XP box). That would at least verifiy the 5353ports.
    Anyone have a bonjour utility to do that? Probably have to run in a Windows enviroment. Or can a ping packet be directed to use a particular port?

  • Bonjour for Windows no longer works after SP3 is installed

    Bonjour for Windows was working fine until SP3 came out. Now I can see the printer and Bonjour goes through the motions to set it up, but I can't print to the printer.
    The whole construct of "Printer.local" or "AirPortExpress.local" doesn't seem to work in a printer Port configuration any more.
    I can ping the Printer.local or AirPortExpress.local in a command window, but the print spooler can't seem to send anything to the printer if the name.local construct is used in the port configuration.
    If I replace the printer.local name in the port configuration with the IP address instead of the printer.local name, I can print fine. The only exception to this is printers hanging off of an AirPortExpress. I can't print to any printer that is attached to an Airport Express. Even if I setup a port to the IP address, I can't print to that printer.
    Another user that had this problem uninstalled SP3, I'm contemplating that now.

    I have Bonjour installed on my ThinkPad running WinXP. It can't see my LAN-connected HP printer. I don't even see an option to add a Bonjour printer.
    ( how do you add a Bonjour printer??
    Nor can any of my Macs see the shared documents folder on the PC. They could before I upgraded to SP3. Sharing for that folder is turned on, of course
    I removed the Bonjour component and reinstalled it. No diference.
    I downloaded the latest Bonjour installer from Apple and installed that.
    Turned firewall off. No difference.
    The Windows Component Manager shows that the Bonjour service is running. I stopped and restarted the service. No joy.
    The Windows Event Viewer shows that the Bonjour service is logging informational error messages ID=1 from time to time.

  • How to connect an HP 111 designjet with my airport extreme 2nd gen with bonjour for windows

    Hi:
    I have an HP 111 Tray, plug into an airport extreme 2nd Gen, both works properly running in a PC with windows 7.
    When I start Bonjour for windows it identify de printer, but when i continue my printer is not in the list, I used the browse buttom and selected the .inf file that is contained in the driver and Bonjour collapsed everytime
    Any one can Help me??
    Thank you guys
    Hola:
    Ante todo buenos dias, os cuento mi problema:
    Tengo una impresora gran formato HP 111 Tray (con bandeja) enchufada a un router Airport Extreme de Apple de 2ª generacion, ambos funcionando correctamente y con las ultimas actualizaciones de firmware, el caso es que al abrir el asistente BOnjour para imprimir en red a la hora de seleccionar la impresora no aparece entre las opciones disponibles, a pesar de reconocerla. Al darle a examinar para que utilize los datos de Información sobre la instalación (.inf) que me he bajado de la pagina, Bonjour se queda colgado siempre
    He probado desde dos ordenadores diferentes conectados a la red y nada
    Alguien sabe como puedo solucionarlo.
    La impresora se conecta con un USB al router de Apple
    Muchas gracias de antemano

    What model and firmware is the 2TB TC?
    What firmware is the AE?
    Does the AE get good signal from the TC in its current location?
    Signal can only be extended that is received intact.
    Is it extending on 5ghz? As I remember it a Gen2 AE is only single band, although you can choose either 2.4ghz or 5ghz.
    I am fairly sure you are going to tell me your TC is AC model..
    I would do a couple of things..
    1. Fix the wireless name, make it short, no spaces and pure alphanumeric.
    2. Fix the wireless channel for 2.4ghz so it is not going to jump around.
    3. Get real results from the AE in its current location for signal strength.. this is really only possible on v5 utility. And that is a double pain with Mavericks because you cannot use it.
    Apple have removed all the useful diagnostics from the airport utility. There is next to nothing left. So you need to use the computer and its diagnostics to find signal levels in the location.
    http://support.apple.com/kb/HT5606

  • If i remove i-tunes then re-install it will i loose all my music? I accidently removed bonjour now can't use remote., If i remove i-tunes then re-install it will i loose all my music? I accidently removed bonjour now can't use remote.

    If i remove i-tunes then re-install it will i loose all my music? I accidently removed bonjour now can't use remote., If i remove i-tunes then re-install it will i loose all my music? I accidently removed bonjour now can't use remote.

    Hello Footr,
    The following article provides the answer to your question, as well as steps for completely removing iTunes and related components:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    iTunes Store purchases or songs imported from CDs are saved in your My Music folder by default and are not deleted by removing iTunes. While it is highly unlikely that you will lose any contents of your iTunes Library when following these steps, it is always a good idea to ensure that your iTunes library is backed up. If you're unsure how to backup, see iTunes: Back up your iTunes library by copying to an external hard drive.
    Thanks,
    Matt M.

  • How can I download itunes when I get the following errors...have installed and uninstalled a dozen times with various fixes...b noir for example and used Revo to clean up..ituneshelper did not install correctly error 7

    How can I download itunes when I get the following errors  ..ituneshelper did not install correctly error 7..I .have installed and uninstalled a dozen times with various fixes...b noir for example and used Revo to clean up.
    This has been a problem for 6 weeks now, I retry when I have time and patience and use my other laptop which is also Windows 7 and runs with no problem.
    Every attempt fails when all seems fine on the desktop and I try to log on to Itunes I get the errors.
    Any help greatly appreciated.
    billymac

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features(Later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (If this won't uninstall press on)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    See also HT1925: Removing and Reinstalling iTunes for Windows XP or HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    Should you get the error iTunes.exe - Entry Point Not Found after the above reinstall then copy QTMovieWin.dll from:
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    and paste into:
    C:\Program Files (x86)\iTunes
    The above paths would be for a 64-bit machine. Hopefully the same fix with the " (x86)" omitted would work on 32-bit systems with the same error.
    tt2

Maybe you are looking for

  • Problems with the new Airport Extreme???

    Have installed the new 802.11n Airport Extreme, replacing an earlier version. New is the use of a USB-connected disc, which I use to backup and sync an iMac and laptop. The disc disappears from the desktops from time to time (12 to 36 hours), and wil

  • Sending emails to one Contact with multiple Addresses

    Hi, I am a volunteer with youth sports, and frequently need to send emails to entire teams of kids.  I have the players all listed as one contact, but have the email addresses both parents and themselves listed under their contact.  When I send an em

  • Typing information into a pdf document

    adobe reader version 8.1.2 I had an employment application sent to me as a pdf attachment to an email. I can open it with the above adobe reader installed on my laptop, but I want to fill out the application by typing in the blanks provided in it. Ho

  • Are not mutually convertible in a Unicode program

    Hi guys, I'm getting error: "LS_EDIDD-SDATA and LS_STRUCTURE are not mutually convertible in Unicode Program" I have PRKST which is Amount field in LS_STRUCTURE, which causes this problem. But if I change type of PRKST to CHAR15, then it doesn't give

  • Post installation for XI

    Hi All, I have installed ECC 6.0. I have added XI component also. Now i need to perform post installation steps for XI alone. i have downloaded the NW7 installation Guide MAXDB. is that enough? or should i need more documents.... Also, i found out a