configure: add option to set default user

The default user is root by default, which disables root dropping by
default. The user directive or the -u option can still be used to set
the user.
This commit is contained in:
Miroslav Lichvar
2014-04-09 16:28:44 +02:00
parent 3edd3fe5a4
commit ff31702f74
5 changed files with 20 additions and 10 deletions

9
configure vendored
View File

@@ -113,6 +113,7 @@ For better control, use the options below.
--disable-rtc Don't include RTC even on Linux
--disable-linuxcaps Disable Linux capabilities support
--disable-forcednsretry Don't retry on permanent DNS error
--with-user=USER Specify default chronyd user [root]
--with-sendmail=PATH Path to sendmail binary [/usr/lib/sendmail]
--enable-debug Enable debugging support
@@ -191,6 +192,7 @@ feat_pps=1
try_setsched=0
try_lockmem=0
feat_forcednsretry=1
default_user="root"
mail_program="/usr/lib/sendmail"
for option
@@ -268,6 +270,9 @@ do
--disable-forcednsretry)
feat_forcednsretry=0
;;
--with-user=* )
default_user=`echo $option | sed -e 's/^.*=//;'`
;;
--with-sendmail=* )
mail_program=`echo $option | sed -e 's/^.*=//;'`
;;
@@ -618,6 +623,7 @@ fi
add_def DEBUG $debug
add_def DEFAULT_CONF_FILE "\"$SYSCONFDIR/chrony.conf\""
add_def DEFAULT_USER "\"$default_user\""
add_def MAIL_PROGRAM "\"$mail_program\""
if [ -f version.txt ]; then
@@ -649,7 +655,8 @@ do
s%@MANDIR@%${MANDIR}%;\
s%@INFODIR@%${INFODIR}%;\
s%@LOCALSTATEDIR@%${LOCALSTATEDIR}%;\
s%@CHRONYVARDIR@%${CHRONYVARDIR}%;"\
s%@CHRONYVARDIR@%${CHRONYVARDIR}%;\
s%@DEFAULT_USER@%${default_user}%;"\
< ${f}.in > $f
done