sbt-native-packager icon indicating copy to clipboard operation
sbt-native-packager copied to clipboard

daemonHome

Open champtar opened this issue 8 years ago • 3 comments
trafficstars

Hi,

by default daemonUser is created with home == /home/<username> (which doesn't exists) as this is a daemon user that would make sense to point to /usr/share/<packageName> or /var/lib/<packageName> or at least to have a config option

EDIT: Using version 1.2.0-M8 packaging .deb for Ubuntu/Debian (but relevant for rpm), creating the package on Ubuntu 16.04 for now

Thanks Etienne

champtar avatar Mar 11 '17 01:03 champtar

Hi @champtar

Thanks for your report. Could you add some details :)

  • Which native-packager version are you using
  • Which package type are you building (rpm or debian)
  • What's your target system (Debian, RHEL, CentOS, Ubuntu,...)
  • What system do you use to build your package (OSX, Ubuntu, ... )

The current implementation handling the user creation is in the control-functions template. There is no home defined. The configuration options are

# Adding system user
# $1 = user
# $2 = uid
# $3 = group
# $4 = description
# $5 = shell (defaults to /bin/false)

The actual call is

useradd $uid_flags --gid $group -r --shell $shell -c "$descr" $user

muuki88 avatar Mar 12 '17 10:03 muuki88

Hi @muuki88, Thanks for your answer I just edited my initial description because <...> where hidden (i forgot to put them between quotes) and I also added missing infos

This is definitely a feature request :) (I know this is not implemented)

Basically we just need to add -d "$home" (haven't checked on all supported platform yet) that point by default to a dir really owned by the package

Regards Etienne

champtar avatar Mar 12 '17 16:03 champtar

Ah :smile:

I'm happy to merge a pull request that adds this feature if you have time. It should be implemented like the uid setting. Meaning a user can optionally add a home directory.

I'm not sure were to directly put this and if native-packager should take care of creating the folder.

muuki88 avatar Mar 12 '17 17:03 muuki88