[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recommended practise for installing files with specific owners/group
From: |
Ton Voon |
Subject: |
Re: Recommended practise for installing files with specific owners/groups |
Date: |
Sun, 25 Mar 2007 15:24:59 +0100 |
Hi,
On 11 Mar 2007, at 00:51, Ton Voon wrote:
I work on the Nagios Plugins project and would like to install our
executables with a specific user and/or group. Looking through the
autoconf and automake manuals, I cannot see any recommended
information on the best way to achieve this. We used to be able to
do this with AM_INSTALL_PROGRAM_FLAGS = -o $user -g $group, but
this is not documented and doesn't appear to work anymore (I think
since we included libtool in our build suite).
What is current best practise? As some shell commands within
install-exec-hook?
I had a reply from Bob Friesenhahn who suggested using install-hook
to execute the chmod and chown commands. This would have involved a
for loop to iterate through the list of executables, which seemed a
bit complex.
My solution in the end was to override the INSTALL variable in
configure.in. I set:
INSTALL="$INSTALL -o nagios -g nagios -m 0550"
INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM -o nagios -g nagios -m
0550"
This then installs with the desired user, group and mode. I realise
there is a dependency on the install program supporting these
options, but I couldn't see how to overcome this.
I'd be happy to contribute some documentation to add to your online
manuals when this is answered.
If this is a good solution, would you like this added to the autoconf
documentation? If so, which file should I patch against?
Ton
http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon