Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: rpm
-
Labels:None
-
Environment:linux (fedora and redhat)
-
Number of attachments :
Description
It would be nice if system administrators could set user and group during installation. This could be realized as either
export RUN_AS_USER=application1User
export RUN_AS_GROUP=applicationGroup
or with parameters to the rpm installation command.
My current workaround is:
if [ "$RUN_AS_USER" = "" ]; then
echo Variable RUN_AS_USER not set, defaulting to root.
export RUN_AS_USER=root
fi
echo Changing ownership according to RUN_AS_USER=$RUN_AS_USER
chown -Rc $RUN_AS_USER $RPM_INSTALL_PREFIX
echo chmod ug+x on directories in $RPM_INSTALL_PREFIX
find $RPM_INSTALL_PREFIX -type d -exec chmod -c ug+x {} \;
The variable RUN_AS_USER was chosen because this variable is read by Java Service Wrapper scripts generated with appassembler-maven-plugin.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Key | MOJO-1232 |
|
| Component/s | rpm [ 12915 ] | |
| Complexity | Intermediate | |
| Project | Mojo [ 11062 ] | Mojo RPM Plugin [ 11970 ] |
| Component/s | rpm [ 13980 ] |
| Original Estimate | 0 minutes [ 0 ] | |
| Assignee | Brett Okken [ bokken ] | |
| Remaining Estimate | 0 minutes [ 0 ] |
| Resolution | Won't Fix [ 2 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
Is there a clean way to do this in the RPM spec file? I think you have this issue with RPMs in general regardless of whether or not Maven is building them.