How to: correctly use sysusers.d?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello packagers,

I'm working on packaging ntpd-rs (an NTP service written in Rust), and
I now have all dependencies available in Fedora, so I need to actually
look into how to package ntpd-rs itself. This is the first time I'm
packaging something that ships a systemd service *and* creates a
custom user / group *and* have that user own system directories, so
I'm unsure how to proceed.

The upstream project contains instructions for cargo-rpm (which is a
tool that's not compatible with Fedora Packaging):
https://github.com/pendulum-project/ntpd-rs/blob/main/ntpd/Cargo.toml#L51-L61

This also includes custom RPM scriptlets adapted from the system
macros in Fedora (that I can't use), which do a bunch of additional
things (like creating "/var/lib/ntpd-rs" with mode 700 owned by
ntpd-rs, and "/etc/ntpd-rs/ntp.toml" with mode 640 and directory owned
by ntpd-rs):
https://github.com/pendulum-project/ntpd-rs/blob/main/pkg/rpm/scriptlets.toml

I would like to replace the non-standard scriptlets with using
sysusers.d for most things, but I'm unsure how to do this correctly. I
tried to follow the Packaging Guidelines here:
https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation
But they don't mention how to have directories owned by user:group
created by sysusers.d config file / scriptlet.

I have a draft sysusers.d config file here:
https://github.com/decathorpe/ntpd-rs-rpms/blob/main/ntpd-rs/ntpd-rs.sysusers

This looks similar to existing files in /usr/lib/sysusers.d/, but the
%sysusers_create_compat scriptlet fails to parse this file (apparently
it doesn't recognise the first line as a comment??) ...

The package needs to create /var/lib/ntpd-rs with mode 700 and have it
owned by the ntpd-rs user, so if I understand correctly, just dropping
in the sysusers.d config file is not enough, since the user won't be
available during the RPM transaction to own this directory. Instead I
would need to invoke the sysusers_crate macro in the package?

My current draft spec is available on GitHub:
https://github.com/decathorpe/ntpd-rs-rpms/blob/main/ntpd-rs/ntpd-rs.spec
(which is still missing handling of the creation / ownership of
/var/lib/ntpd-rs and /etc/ntpd-rs/ntp.toml).

Any help would be appreciated.
Fabio
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux