{"id":16813294,"url":"https://github.com/ivanvc/daemoncontroller","last_synced_at":"2025-04-11T01:51:58.398Z","repository":{"id":66900183,"uuid":"1808809","full_name":"ivanvc/DaemonController","owner":"ivanvc","description":"Easy control of daemons using Objective C. Based in DaemonController by mxcl.","archived":false,"fork":false,"pushed_at":"2011-06-18T18:27:03.000Z","size":112,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T23:15:03.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://ivanvc.github.com/DaemonController","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanvc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-27T09:09:25.000Z","updated_at":"2021-10-01T14:54:41.000Z","dependencies_parsed_at":"2023-02-20T13:55:22.795Z","dependency_job_id":null,"html_url":"https://github.com/ivanvc/DaemonController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2FDaemonController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2FDaemonController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2FDaemonController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2FDaemonController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanvc","download_url":"https://codeload.github.com/ivanvc/DaemonController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328108,"owners_count":21085258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T10:25:56.318Z","updated_at":"2025-04-11T01:51:58.377Z","avatar_url":"https://github.com/ivanvc.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"DaemonController\n================\n\nThis is an adaptation of the DaemonController class from Max Howell. The idea is to create a simple controller,\nthat can wach, start and stop any daemon, just passing the launchPath of the daemon. It will execute several\noptional callbacks to give feedback about the status of the daemon.\n\nInstallation\n------------\n\nJust add the FFYDaemonController header and implementation files. Then, be sure to add the FFYDaemonController.m\nfile to your desired target.\n\nUsage\n-----\n\nJust include the FFYDaemonController.h file in your Class:\n\n    include \"FFYDaemonController.h\";\n\nThen, create an instance of it\n\n    FFYDaemonController *daemonController = [[FFYDaemonController alloc]\n      init];\n\nSet the launch path for the Daemon to watch:\n\n    daemonController.launchPath =\n      @\"/usr/local/Cellar/mysql/5.1.56/libexec/mysqld\";\n\nSet the initialization arguments, if any:\n\n    daemonController.startArguments = [NSArray arrayWithObjects:\n      @\"--basedir=/usr/local/Cellar/mysql/5.1.56\",\n      @\"--datadir=/usr/local/var/mysql\",\n      @\"--log-error=/usr/local/var/mysql/localjost.local.err\",\n      @\"--pid-file=/usr/local/var/mysql/localjost.local.pid\", nil];\n\nFinally,  there's an especial list of arguments in order to stop the daemon:\n\n    daemonController.stopArguments = [NSArrary arrayWithObjects:\n      @\"stop\", nil];\n\n### Start/Stop\n\nTo start and stop the daemon just call:\n\n    [daemonController start];\n    [daemonController stop];\n\n### Callbacks\n\nThere are several callbacks, here are described the ones used. All of them are optional.\n\n#### Start callback\n\nWhenever the daemon is started this notification is called. The block receives an NSNumber,\nthis is the PID of the started daemon.\n\n    typedef void (^DaemonStarted)(NSNumber *);\n\n#### Stop callback\n\nWhen the daemon is stopped, this callback is called.\n\n    typedef void (^DaemonStopped)();\n\n#### Starting/Stopping callbacks\n\nWhen the daemon is going to be started or stopped, these callbacks are called.\n\n    typedef void (^DaemonIsStarting)();\n    typedef void (^DaemonIsStopping)();\n\n#### Failure callbacks\n\nWhen the daemon failes to start or stop, these callbacks are called, passing an NSString,\nthat contains the reason of the failure.\n\n    typedef void (^DaemonFailedToStart)(NSString *);\n    typedef void (^DaemonFailedToStop)(NSString *);\n\nMore information\n----------------\n\nSee the commented source at http://ivanvc.github.com/DaemonController\n\nCredits\n-------\n\nBased in [DaemonController](https://github.com/mxcl/playdar.prefpane/blob/master/DaemonController.h),\nby [Max Howell](http://methylblue.com/).\n\nLicense\n-------\n\nReleased under MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvc%2Fdaemoncontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanvc%2Fdaemoncontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvc%2Fdaemoncontroller/lists"}