AGENTS.md is read on every task, so it keeps routing, the hard stops, the install and keyword gates and the completion report, and drops to 514 words; all rule files together drop from 7546 to 5783 words. Rules state the result to reach, and keep a prohibition only where a mistake is hard to undo or a reviewer has caught it before. Lessons from reviewed PRs: PATCHES carried over a bump, Go -ldflags without -s or -w, RUST_MIN_VER from the highest rust-version, cargo QA_FLAGS_IGNORED, ISA gating through cpu_flags, Python Requires-Dist, draft PRs for eclass provider slots missing from ::gentoo, skel.ebuild variable order, DependencyMissingKeywords, and the Go vendor layout. The PR template asks for the reason, a Tested: line and two checks, and names the merge-base scan range so it is not read as a bare --commits. Signed-off-by: Zakk <zakk@gentoozh.org>
2.5 KiB
2.5 KiB
OpenRC and systemd
Read with: dependencies.md for the revbump a changed unit or script needs; new-packages.md or version-bumps.md for the change itself.
- On OpenRC, use
virtual/udevandvirtual/tmpfilesfor those helpers; their providers supply neithersystemctlnor a service manager. - Require
sys-apps/systemdonly for features absent fromsystemd-utils, such assystemctlorlibsystemd. That blocks theelogindandsystemd-utilsan OpenRC install normally has: report the conflict instead of restoring an any-of thatsystemd-utilscannot satisfy. - Leave the
systemdUSE default to profiles, so optional hooks remain optional on OpenRC. - Long-running service units include an OpenRC script. Express flag-only variants as conf.d variables.
- A template and plain unit share one plain-named script. Read
${RC_SVCNAME#*.}for instances; admins symlink/etc/init.d/<name>.<instance>to it, as innet-analyzer/nfdump. Without a suffix it returns the service name: provide a default or refuse with a message. - Follow
net-dns/knot-resolver/files/kresd.initd-r2: conf.d defaults,command_backgroundwithpidfile,command_user,capabilities, andcheckpathinstart_pre. - Preserve OpenRC's unsupervised default when translating
Restart=; leavesupervisorunset for that purpose.Restart=nostays without automatic restarts. - Map
AmbientCapabilitiestocapabilities,LimitNOFILEtorc_ulimit,Environmenttoexport, andWorkingDirectorytodirectory. - Map
RuntimeDirectorytocheckpath -dinstart_pre; useewaitfileinstart_postfor anExecStartPostpath wait. - Remove sockets in
stop_post, assys-apps/dbusdoes, sostart_postmode fixes target the new socket. capabilitiesuses cap_iab(3):^cap_xgrants ambient capabilities;!cap_xdrops bounding-set capabilities.required_fileslists only startup prerequisites, excluding files the daemon creates on first run. Fix individual path modes directly;umaskaffects all daemon-created files.- Add
output_logonly when needed. Undercommand_user, its directory belongs to that user becausestart-stop-daemonopens redirection after dropping privilege. - Installed
ExecStartpaths match ebuild destinations, including/usr/sbinfornewsbin. - Start the service and exercise its function: a responsive port, CLI socket, or end-to-end traffic. Verify the daemon stays running after startup. Without OpenRC, install the package, report the script untested, and fix reported problems.