site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=LsZCzYTSgmYtoelr8Qkq/Egk/nFy6sDqkUNN0MHDJOY=; b=Y2PqbT+oWCOwgt8266t2Pu/YOzzr6KQ4I6+vRbgJCeYmg3jsju7WjDShVXybEMrZ4f KdxcJkBDm72OmC8/FBuGeXCPrk6lKoCDvkUSEAONUYnKLwgTvR+yWeYeApp78QUPswGY 2XTQyzW9lyqNNOweJIaj1v6uMGrawD6lAW6Eo= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=I6IxtJ/YxXLS0n+Rocg2i6HWLjmdDLUJY/1UBiN39R/H8aKJ8uKHHmxO9nCqNZVT16 8VoZN4beZDmSAFp+VdH0F7K9/P0KpEGFZI6CjyEWAj5sFsXs0+jHeML0LV+ZTx5ynBJu 5UKZFKrDtiVwXg6xeFpbcIHVV9NiIZCwfyC9s= On Jan 12, 2009, at 08:55 , Rakesh Singhal wrote: Hi Jason, Thanks but I knew this thing. Is there any other way to do the same thing only on the basis of name of daemon application. launchctl start mydaemon launchctl stop mydaemon #!/bin/bash case "$1" in stop) /bin/launchctl stop com.mycompany.mydaemon.daemon ;; restart) /bin/launchctl stop com.mycompany.mydaemon.daemon ;; *) echo "Usage $0 { stop|start|restart|status } exit 1 esac HTH, Jason _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I think we can not do even by using StartupItems. Using the dot notation for your daemon is just the suggested form (although it's suggested for a good reason). You can use whatever label you wish. Just make the label in the plist the same as the name of the daemon and then you can start and stop it using just the daemon's name. That's basically the way it's done. If you want to give users something else to start and stop the daemon, you can create a simple script that calls launchctl. For example: start) /bin/launchctl start com.mycompany.mydaemon.daemon # use whatever label is in the plist ;; status) if (/bin/launchctl list | grep com.mycompany.mydaemon.daemon >/ dev/null); then echo Daemon is running else echo Daemon is not running fi ;; You can also write an application which uses the launchd api to programatically start and stop the daemon. This way you could write a little gui app to control it or a system panel to toggle it on or off. If you wish to do it this way, see the API in /usr/include/launch.h This email sent to site_archiver@lists.apple.com