From 1f3af04db77f9e9e707bd37ee85f6508aef797f2 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Fri, 12 Apr 2013 07:14:18 +0000 Subject: packages: add ability for packages to create users Packages that install daemons may need those daemons to run as a non-root, or an otherwise non-system (eg. 'daemon'), user. Add infrastructure for packages to create users, by declaring the FOO_USERS variable that contain a makedev-syntax-like description of the user(s) to add. Signed-off-by: "Yann E. MORIN" Cc: Samuel Martin Cc: Cam Hutchison Cc: Thomas Petazzoni Acked-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Peter Korsgaard --- docs/manual/adding-packages-generic.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/manual/adding-packages-generic.txt') diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index a615ae2c9..aa94b8869 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -53,7 +53,11 @@ system is based on hand-written Makefiles or shell scripts. 36: /bin/foo f 4755 0 0 - - - - - 37: endef 38: -39: $(eval $(generic-package)) +39: define LIBFOO_USERS +40: foo -1 libfoo -1 * - - - LibFoo daemon +41: endef +42: +43: $(eval $(generic-package)) -------------------------------- The Makefile begins on line 7 to 11 with metadata information: the @@ -140,7 +144,10 @@ On line 31..33, we define a device-node file used by this package On line 35..37, we define the permissions to set to specific files installed by this package (+LIBFOO_PERMISSIONS+). -Finally, on line 39, we call the +generic-package+ function, which +On lines 39..41, we define a user that is used by this package (eg. +to run a daemon as non-root) (+LIBFOO_USERS+). + +Finally, on line 43, we call the +generic-package+ function, which generates, according to the variables defined previously, all the Makefile code necessary to make your package working. @@ -307,6 +314,11 @@ information is (assuming the package name is +libfoo+) : You can find some documentation for this syntax in the xref:makedev-syntax[]. This variable is optional. +* +LIBFOO_USERS+ lists the users to create for this package, if it installs + a program you want to run as a specific user (eg. as a daemon, or as a + cron-job). The syntax is similar in spirit to the makedevs one, and is + described in the xref:makeuser-syntax[]. This variable is optional. + * +LIBFOO_LICENSE+ defines the license (or licenses) under which the package is released. This name will appear in the manifest file produced by +make legal-info+. -- cgit v1.2.3