Is it possible to start new daemon directly with standard daemon?


I develop a new daemon to preregister user from our AD so as to attribute rights before waiting the first connection.

There is a way to start daemon with phd start directly ? To avoid using phd launch and keep working the auto restart based linux service that use phd start/stop


There’s no way to do it through configuration. You can modify these lines in PhabricatorDaemonManagementWorkflow if you don’t mind maintaining a small fork:

    $daemons = array(
        'class' => 'PhabricatorRepositoryPullLocalDaemon',
        'label' => 'pull',
        'class' => 'PhabricatorTriggerDaemon',
        'label' => 'trigger',
        'class' => 'PhabricatorFactDaemon',
        'label' => 'fact',
        'class' => 'PhabricatorTaskmasterDaemon',
        'label' => 'task',
        'pool' => PhabricatorEnv::getEnvConfig('phd.taskmasters'),
        'reserve' => idx($options, 'reserve', 0),

Very old versions of Phabricator supported direct configuration of which daemons should launch, but this was a source of confusion and almost never had legitimate use cases so it was removed years ago to simplify things.

After upcoming changes in you will likely be able to implement this kind of task without implementing a separate daemon (instead, you could implement a task generator which generates a new task once every hour).

Today, you can sort of accomplish this by either implementing a GarbageCollector that just runs a periodic task, or by attaching a WorkerTrigger with an hourly PhabricatorMetronomicTriggerClock to some application object, but both of these approaches are probably quite a bit messier than implementing a daemon.

Thanks for your answer :slight_smile:

I already maintained a fork but i want to keep the fork for only developments they can not be in the extension module. And i keep Fork and Extension completely independent.

May be re-add configuration for choosing daemon :rofl: