PHPackages                             miksoftware/daemon-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. miksoftware/daemon-bundle

ActiveSymfony-bundle

miksoftware/daemon-bundle
=========================

Symfony2 Daemon Bundle

0.9.3(12y ago)5128.1k↓25.6%1BSD-3-ClausePHPPHP &gt;=5.3.2

Since May 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/m1ksoftware/daemon-bundle)[ Packagist](https://packagist.org/packages/miksoftware/daemon-bundle)[ Docs](https://github.com/m1ksoftware/daemon-bundle.git)[ RSS](/packages/miksoftware-daemon-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

DaemonBundle
============

[](#daemonbundle)

[![PayPayl donate button](https://camo.githubusercontent.com/92145c5be2722a9fffe03a03bda3b6ae15fb31a5d241afce6ca164845d64824c/687474703a2f2f696d672e736869656c64732e696f2f70617970616c2f646f6e6174652e706e673f636f6c6f723d677265656e)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NFQGD52UP2RLA "Donate once-off to this project using Paypal")[![Latest Stable Version](https://camo.githubusercontent.com/3d77067bff1604c2c0b3de6b0acc87ec00280c09d91379b9df53cd18bb4fca9d/68747470733a2f2f706f7365722e707567782e6f72672f6d696b736f6674776172652f6461656d6f6e2d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/miksoftware/daemon-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/8b612a6565b526a33ba8b94c7d96ddc4d36e0fe7b626e01798130c4a9dfc8f10/68747470733a2f2f706f7365722e707567782e6f72672f6d696b736f6674776172652f6461656d6f6e2d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/miksoftware/daemon-bundle)[![License](https://camo.githubusercontent.com/4338cd8861ae91a744b01899b2e22a9632170a5ba3b7c2f88ac5e966d4a55543/68747470733a2f2f706f7365722e707567782e6f72672f6d696b736f6674776172652f6461656d6f6e2d62756e646c652f6c6963656e73652e706e67)](https://packagist.org/packages/miksoftware/daemon-bundle)

DeamonBundle allows to easily convert your Symfony2 console scripts into system daemons. To use DaemonBundle `pcntl` is required to be configured in your PHP binary.

DaemonBundle is a based in the PEAR library [System\_Daemon](http://pear.php.net/package/System_Daemon/redirected) which was created by Kevin Vanzonneveld and it is highly inspaired by [uecode/daemon-bundle](https://github.com/uecode/daemon-bundle).

System\_Daemon Package
----------------------

[](#system_daemon-package)

System\_Daemon is a PHP class that allows developers to create their own daemon applications on Linux systems. The class is focussed entirely on creating and spawning standalone daemons. More information can be found at:

- [Create Daemons in PHP](http://kvz.io/blog/2009/01/09/create-daemons-in-php/)
- [System\_Daemon PEAR Package](http://pear.php.net/package/System_Daemon/redirected)

Installation
------------

[](#installation)

1. Add this bundle to the `composer.json` file of your project.

    ```
    php composer.phar require miksoftware/daemon-bundle dev-master
    ```
2. Add the bundle to your application kernel.

    ```
    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new MikSoftware\DaemonBundle\MikSoftwareDaemonBundle()
            // ...
        );
    }
    ```
3. Configure the bundle by adding parameters to the `config.yml` or `parameters.yml` file:

    ```
    # app/config/config.yml

    mik_software_daemon:
        daemons:
            : ~
    ```

Configuration Parameters
------------------------

[](#configuration-parameters)

To change any configuration setting, you could add required parameters to your project config. Following, an example of a minimal required configuration.

```
mik_software_daemon:
    daemons:
        : ~
```

Other available parameters (with default values):

```
mik_software_daemon:
    daemons:
        : ~
            appName: systemDaemon
            appDir: %kernel.root_dir%
            appDescription: System Daemon
            logDir: %kernel.logs_dir%
            authorName: ~
            authorEmail: ~
            appPidDir: %kernel.cache_dir%/daemons/
            sysMaxExecutionTime: 0
            sysMaxInputTime: 0
            sysMemoryLimit: 1024M
            appUser: www-data
            appGroup: www-data
            appRunAsGID: 1000
            appRunAsUID: 1000
            logVerbosity: info
```

Usage
-----

[](#usage)

1. Create a Symfony2 command that extends from `DaemonizedCommand`:

    ```
