Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] restart -g -d runs in the foreground

Open
#957 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, symfony
Domain
backend, cli, testing

Research direction

Start by reading src/ServerManager.php lines 156–166 and Workerman’s argument handling at vendor/workerman/workerman/src/Worker.php lines 1095–1103; then check the relevant test setup and docs/commands.md. Verify with a real run that both option orders start as a daemon, add a test for the behavior, and update the docs so they no longer advise avoiding the options together.

Written by the indexing model from the issue text.

Description

priority:low type:bug

Problem

If you use both -g and -d in one command, the order of the two options decides the result.
bin/console workerman:server restart -g -d can start the server in the foreground, not as a daemon.

How to see it

  • src/ServerManager.php:156-166 builds Worker::$command from -d and -g and gives it to Workerman.
  • vendor/workerman/workerman/src/Worker.php:1095-1103 reads the real $argv first and then Worker::$command. It keeps only the first mode it finds (-d or -g).
  • So with -g -d in the shell, only -g is used and the daemon mode is lost.
  • This was found by reading the code. It was not tried with a real server yet.

Fix idea

  • Set Worker::$daemonize directly, or
  • pass only one mode string to Workerman and keep -d and -g apart.

Done when

  • The behaviour is checked with a real run.
  • restart -g -d and restart -d -g both run as a daemon.
  • A test covers it.
  • docs/commands.md no longer says to avoid the two options together.
Dominant language
PHP
Stars
2
Forks
3
Avg merge
39m
Merged PRs (30d)
105

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crazy-goat/workerman-bundle

All issues in crazy-goat/workerman-bundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.