systemd / systemd/systemd

machinectl shell/logind does weird thing when processes are started on background

Open
#5,878 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

machine RFE 🎁
Dominant language
C
Stars
16.7k
Forks
4.7k
Avg merge
1d 6h
Merged PRs (30d)
140

Description

Submission type
  • [ x] Bug report
systemd version the issue has been seen with

systemd-231-14.fc25.x86_64 (probably also upstream one)

I've called command
# machinectl shell x /bin/bash -c "nohup sleep 100 &"
and then I've checked if sleep is running there.
NO SLEEP process inside

then I've added sleep 1 after background process and it works well:
# machinectl shell x /bin/bash -c "nohup sleep 100 & sleep 1"
process sleep 100 is there and working well.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the two machinectl shell commands and compare how the background process is handled with and without the trailing sleep. Trace the machinectl shell/logind entry points involved, then add a regression test showing that nohup sleep 100 remains running without a foreground command afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, shell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.