Bug 254511

Summary: daemon(8): Allow to set daemonized process realtime or idletime scheduling priority
Product: Base System Reporter: Yuri Victorovich <yuri>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: cem, freebsd, grahamperrin, ihor, pmc
Priority: --- Keywords: feature
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254730
Attachments:
Description Flags
daemon-add-priority.patch
none
daemon-add-priority.patch
none
daemon-add-priority.patch
none
daemon-add-priority.patch none

Description Yuri Victorovich freebsd_committer freebsd_triage 2021-03-23 18:28:30 UTC
Created attachment 223530 [details]
daemon-add-priority.patch

The attached patch adds arguments -e {priority}, -i {priority} for realtime and idle priorities respectively.

These arguments can be used when the process should run with an altered priority level.

rtprio(1) generally sets priority process level, but in case of daemon(8) invocation rtprio(1) can't be used as a separate command.

Running 'rtprio {priority} daemon ... commmand ...' would also change daemon(8) process' priority which isn't what is desired.

Running 'daemon ... rtprio {priority} command ...' can't generally work because daemon(8) can change process' user and rtprio(1) would fail.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2021-03-24 00:27:38 UTC
Created attachment 223535 [details]
daemon-add-priority.patch
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2021-03-24 00:34:31 UTC
Created attachment 223536 [details]
daemon-add-priority.patch
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2021-03-24 00:38:52 UTC
Created attachment 223537 [details]
daemon-add-priority.patch
Comment 4 Ihor Antonov 2023-03-06 04:14:28 UTC
I am working on daemon improvements and this feature is planned to be added once transition to kqueue is finished.
Comment 5 Mina Galić freebsd_triage 2023-04-14 20:18:16 UTC
honestly, I think this feature belongs into rc, not into daemon.
Comment 6 Peter Much 2023-04-24 13:30:41 UTC
I agree with Mina Galic. I would prefer having this feature in rc, alongside with another feature to set an arbitrary login-class (which would allow dynamic ressource management via rctl)