> On 09/23/2011 08:15 AM, "Igor Maravić" wrote: >> When XORP user is initially created with xorp_install.sh script, I think >> that it is better to create user as system user without home dir. >> BR >> Igor Maravić >> >> Signed-off-by: Igor Maravić<[email protected]> >> --- >> --- xorp/xorp_install.bash.orig 2011-09-23 17:08:41.405949155 +0200 >> +++ xorp/xorp_install.bash 2011-09-23 17:05:34.021949091 +0200 >> @@ -19,7 +19,7 @@ fi >> >> # Add xorp user and group >> echo "Creating xorp user and adding xorp to xorp and root groups..." >> -adduser xorp >> +adduser --system --no-create-home xorp >> usermod -a -G xorp xorp >> usermod -a -G xorp root >> usermod -a -G xorp lanforge > > On Fedora Core 5, this does not work. The --no-create-home option > is not supported. The -M option appears to be, and it means do > not create a home dir. FC5 does not support the --system option > either. I've no idea what Debian and similar systems > support. > > If you'd like to make the script smart enough to detect which options > are available (maybe try each until something succeeds?), then > I'll apply the patch. > > Otherwise, I'll leave it as it is. > > Thanks, > Ben > >> >> >> _______________________________________________ >> Xorp-hackers mailing list >> [email protected] >> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers > > > -- > Ben Greear <[email protected]> > Candela Technologies Inc http://www.candelatech.com > >
Here is the patch for smart script! It checks if adduser supports --system and --no-create-home. Checking for -M option could be added, but I don't have fedora to test it. I'm running Ubuntu 11.04 with kernel 2.6.38.8 Signed-off-by: Igor Maravić <[email protected]> --- --- xorp/xorp_install.bash.orig 2011-09-23 17:08:41.405949155 +0200 +++ xorp/xorp_install.bash.new 2011-09-26 09:49:14.000000000 +0200 @@ -18,8 +18,21 @@ if [ `pwd` != "/usr/local/xorp" ] fi # Add xorp user and group + +#Check for adduser commands +adduserArgs="" +if adduser -h | grep ".--system" > /dev/null 2>&1 +then + adduserArgs="$adduserArgs --system" +fi + +if adduser -h | grep ".--no-create-home" > /dev/null 2>&1 +then + adduserArgs="$adduserArgs --no-create-home" +fi + echo "Creating xorp user and adding xorp to xorp and root groups..." -adduser xorp +adduser $adduserArgs xorp usermod -a -G xorp xorp usermod -a -G xorp root usermod -a -G xorp lanforge _______________________________________________ Xorp-hackers mailing list [email protected] http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
